Petr Sumbera
2017-09-21 8523e6cb08a3cdbc476130beaba1c3ea0674e5e9
26828028 fix regression with librsvg after update to libxml 2.9.5
1 files added
1 files modified
56 ■■■■■ changed files
components/library/libxml2/Makefile 1 ●●●● patch | view | raw | blame | history
components/library/libxml2/patches/12-b90d8989d3dc486519686f01490379c963bd1145.patch 55 ●●●●● patch | view | raw | blame | history
components/library/libxml2/Makefile
@@ -28,6 +28,7 @@
COMPONENT_NAME=        libxml2
COMPONENT_VERSION=    2.9.5
COMPONENT_REVISION=    1
COMPONENT_PROJECT_URL=    http://xmlsoft.org/
COMPONENT_SRC=        $(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE=    $(COMPONENT_SRC).tar.gz
components/library/libxml2/patches/12-b90d8989d3dc486519686f01490379c963bd1145.patch
New file
@@ -0,0 +1,55 @@
From b90d8989d3dc486519686f01490379c963bd1145 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Tue, 19 Sep 2017 15:45:35 +0200
Subject: Fix regression with librsvg
Instead of using xmlCreateIOParserCtxt, librsvg pushes its own
xmlParserInput on top of a memory push parser. This incorrect use of
the API confuses several parser checks and, since 2.9.5, completely
breaks documents with internal subsets. Work around the problem with
internal subsets.
Thanks to Petr Sumbera for the report:
    https://mail.gnome.org/archives/xml/2017-September/msg00011.html
Also see
    https://bugzilla.gnome.org/show_bug.cgi?id=787895
---
 parser.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/parser.c b/parser.c
index 770f846..28d0cd2 100644
--- a/parser.c
+++ b/parser.c
@@ -8271,6 +8271,7 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
      * Is there any DTD definition ?
      */
     if (RAW == '[') {
+        int baseInputNr = ctxt->inputNr;
         ctxt->instate = XML_PARSER_DTD;
         NEXT;
     /*
@@ -8278,7 +8279,7 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
      * PEReferences.
      * Subsequence (markupdecl | PEReference | S)*
      */
-    while (((RAW != ']') || (ctxt->inputNr > 1)) &&
+    while (((RAW != ']') || (ctxt->inputNr > baseInputNr)) &&
                (ctxt->instate != XML_PARSER_EOF)) {
         const xmlChar *check = CUR_PTR;
         unsigned int cons = ctxt->input->consumed;
@@ -8290,7 +8291,7 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
         if ((CUR_PTR == check) && (cons == ctxt->input->consumed)) {
         xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR,
          "xmlParseInternalSubset: error detected in Markup declaration\n");
-                if (ctxt->inputNr > 1)
+                if (ctxt->inputNr > baseInputNr)
                     xmlPopInput(ctxt);
                 else
             break;
--
cgit v0.12