From f5080d27945c5067897c5158ed90029c4931afad Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Mon, 5 Aug 2013 11:04:47 +0800 Subject: Add upstream patch to fix XPath evaluation issue (Closes: #713146) --- ...07-Fix-XPath-optimization-with-predicates.patch | 27 ++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 28 insertions(+) create mode 100644 debian/patches/0007-Fix-XPath-optimization-with-predicates.patch 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 +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 -- cgit v1.2.3