1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-10 08:58:16 +03:00

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.
This commit is contained in:
David Kilzer 2017-06-16 21:30:42 +02:00 committed by Nick Wellnhofer
parent 01a4b81a03
commit 3f0627a1ee

View File

@ -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;
}