[libxml2] Fix duplicate SAX callbacks for entity content



commit 3f0627a1ee854dc965bf61dd6466a798b80cf088
Author: David Kilzer <ddkilzer apple com>
Date:   Fri Jun 16 21:30:42 2017 +0200

    Fix duplicate SAX callbacks for entity content
    
    Reset 'was_checked' to prevent entity from being parsed twice and SAX
    callbacks being invoked twice if XML_PARSE_NOENT was set.
    
    This regressed in version 2.9.3 and caused problems with WebKit.
    
    Fixes bug 760367.

 parser.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/parser.c b/parser.c
index 1e23d26..7ef6028 100644
--- a/parser.c
+++ b/parser.c
@@ -7418,6 +7418,9 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
        }
        if (ent->checked == 0)
            ent->checked = 2;
+
+        /* Prevent entity from being parsed and expanded twice (Bug 760367). */
+        was_checked = 0;
     } else if (ent->checked != 1) {
        ctxt->nbentities += ent->checked / 2;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]