summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorDavid Kilzer <ddkilzer@apple.com>2017-06-16 21:30:42 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2017-06-16 21:30:42 +0200
commit3f0627a1ee854dc965bf61dd6466a798b80cf088 (patch)
treeb83fc678c4373fad6afc951d17a1c12342368e25 /parser.c
parent01a4b81a036228d7c692f29e5f306ff0d510597f (diff)
downloadlibxml2-3f0627a1ee854dc965bf61dd6466a798b80cf088.tar.gz
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.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c3
1 files changed, 3 insertions, 0 deletions
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;
}