xzyang / rpms / libxml2

Forked from rpms/libxml2 3 years ago
Clone

Blame SOURCES/libxml2-Avoid-extra-processing-of-MarkupDecl-when-EOF.patch

267d54
From eb1114e90b22e09d500840bac1e171763e8baa16 Mon Sep 17 00:00:00 2001
267d54
From: Hugh Davenport <hugh@allthethings.co.nz>
267d54
Date: Tue, 3 Nov 2015 20:40:49 +0800
267d54
Subject: [PATCH] Avoid extra processing of MarkupDecl when EOF
267d54
To: libvir-list@redhat.com
267d54
267d54
For https://bugzilla.gnome.org/show_bug.cgi?id=756263
267d54
267d54
One place where ctxt->instate == XML_PARSER_EOF whic was set up
267d54
by entity detection issues doesn't get noticed, and even overrided
267d54
267d54
Signed-off-by: Daniel Veillard <veillard@redhat.com>
267d54
---
267d54
 parser.c | 8 ++++++++
267d54
 1 file changed, 8 insertions(+)
267d54
267d54
diff --git a/parser.c b/parser.c
267d54
index b56d94c..262db1e 100644
267d54
--- a/parser.c
267d54
+++ b/parser.c
267d54
@@ -6952,6 +6952,14 @@ xmlParseMarkupDecl(xmlParserCtxtPtr ctxt) {
267d54
 	    xmlParsePI(ctxt);
267d54
 	}
267d54
     }
267d54
+
267d54
+    /*
267d54
+     * detect requirement to exit there and act accordingly
267d54
+     * and avoid having instate overriden later on
267d54
+     */
267d54
+    if (ctxt->instate == XML_PARSER_EOF)
267d54
+        return;
267d54
+
267d54
     /*
267d54
      * This is only for internal subset. On external entities,
267d54
      * the replacement is done before parsing stage
267d54
-- 
267d54
2.5.0
267d54