summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authorAron Xu <aron@debian.org>2013-08-05 11:04:47 +0800
committerAron Xu <aron@debian.org>2013-08-05 11:04:47 +0800
commitf5080d27945c5067897c5158ed90029c4931afad (patch)
tree684daacc1ca2b3e18bb7e30a76ad8dec3fb96665 /debian/patches
parent9afca292b056860493ebcc41994f2278e5e31357 (diff)
downloadlibxml2-f5080d27945c5067897c5158ed90029c4931afad.tar.gz
Add upstream patch to fix XPath evaluation issue (Closes: #713146)
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/0007-Fix-XPath-optimization-with-predicates.patch27
-rw-r--r--debian/patches/series1
2 files changed, 28 insertions, 0 deletions
diff --git a/debian/patches/0007-Fix-XPath-optimization-with-predicates.patch b/debian/patches/0007-Fix-XPath-optimization-with-predicates.patch
new file mode 100644
index 0000000..f24424a
--- /dev/null
+++ b/debian/patches/0007-Fix-XPath-optimization-with-predicates.patch
@@ -0,0 +1,27 @@
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Sun, 4 Aug 2013 22:15:11 +0000
+Subject: Fix XPath '//' optimization with predicates
+
+My attempt to optimize XPath expressions containing '//' caused a
+regression reported in bug #695699. This commit disables the
+optimization for expressions of the form '//foo[predicate]'.
+---
+ xpath.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/xpath.c b/xpath.c
+index 97410e7..a676989 100644
+--- a/xpath.c
++++ b/xpath.c
+@@ -14719,8 +14719,9 @@ xmlXPathOptimizeExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op)
+ * internal representation.
+ */
+
+- if ((op->ch1 != -1) &&
+- (op->op == XPATH_OP_COLLECT /* 11 */))
++ if ((op->op == XPATH_OP_COLLECT /* 11 */) &&
++ (op->ch1 != -1) &&
++ (op->ch2 == -1 /* no predicate */))
+ {
+ xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
+
diff --git a/debian/patches/series b/debian/patches/series
index 877bddb..cae4aea 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@
0004-xmllint-memory-should-fail-on-empty-files.patch
0005-properly-quote-the-namespace-uris-written-out-during.patch
0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch
+0007-Fix-XPath-optimization-with-predicates.patch