diff --git a/libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch b/libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch new file mode 100644 index 0000000..1b62d69 --- /dev/null +++ b/libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch @@ -0,0 +1,54 @@ +From 3157cf4e53c03bc3da604472c015c63141907db8 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer +Date: Wed, 20 Sep 2017 16:13:29 +0200 +Subject: [PATCH] Report undefined XPath variable error message +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit c851970 removed a redundant error message if XPath evaluation +failed. This uncovered a case where an undefined XPath variable error +wasn't reported correctly. + +Thanks to Petr Pisar for the report. + +Fixes bug 787941. + +Signed-off-by: Petr Písař +--- + xpath.c | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +diff --git a/xpath.c b/xpath.c +index 2c1b2681..94815075 100644 +--- a/xpath.c ++++ b/xpath.c +@@ -13531,10 +13531,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) + xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); + if (op->value5 == NULL) { + val = xmlXPathVariableLookup(ctxt->context, op->value4); +- if (val == NULL) { +- ctxt->error = XPATH_UNDEF_VARIABLE_ERROR; +- return(0); +- } ++ if (val == NULL) ++ XP_ERROR0(XPATH_UNDEF_VARIABLE_ERROR); + valuePush(ctxt, val); + } else { + const xmlChar *URI; +@@ -13549,10 +13547,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) + } + val = xmlXPathVariableLookupNS(ctxt->context, + op->value4, URI); +- if (val == NULL) { +- ctxt->error = XPATH_UNDEF_VARIABLE_ERROR; +- return(0); +- } ++ if (val == NULL) ++ XP_ERROR0(XPATH_UNDEF_VARIABLE_ERROR); + valuePush(ctxt, val); + } + return (total); +-- +2.13.5 + diff --git a/libxml2.spec b/libxml2.spec index cad04f5..f0c1a2a 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -3,7 +3,7 @@ Summary: Library providing XML and HTML support Name: libxml2 Version: 2.9.5 -Release: 1%{?dist}%{?extra_release} +Release: 2%{?dist}%{?extra_release} License: MIT Group: Development/Libraries Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz @@ -21,6 +21,9 @@ Patch1: libxml2-2.9.0-do-not-check-crc.patch # In python3.6 _PyVerify_fd is no more # http://bugs.python.org/issue23524 Patch2: libxml2-2.9.4-remove-pyverify_fd.patch +# Fix reporting error about undefined XPath variables, bug #1493613, +# Gnome bug #787941, fixed in upstream after 2.9.5 +Patch3: libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch %description This library allows to manipulate XML files. It includes support @@ -107,6 +110,7 @@ at parse time or later once the document has been modified. %if 0%{?fedora} > 25 %patch2 -p1 %endif +%patch3 -p1 mkdir py3doc cp doc/*.py py3doc @@ -218,6 +222,9 @@ rm -fr %{buildroot} %changelog +* Fri Sep 22 2017 Petr Pisar - 2.9.5-2 +- Fix reporting error about undefined XPath variables (bug #1493613) + * Mon Sep 4 2017 Daniel Veillard - 2.9.5-1 - update to 2.9.5