From 3f0627a1ee854dc965bf61dd6466a798b80cf088 Mon Sep 17 00:00:00 2001 From: David Kilzer Date: Fri, 16 Jun 2017 21:30:42 +0200 Subject: 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 file changed, 3 insertions(+) (limited to 'parser.c') diff --git a/parser.c b/parser.c index 1e23d26a..7ef6028b 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; } -- cgit v1.2.1