summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2017-06-10 17:06:16 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2017-06-10 18:00:55 +0200
commitfb2f518cc61239a4010612c9307a3fd7d13c996c (patch)
tree944b64e4416229c03e45b8847a0c1e1f06d09593 /parser.c
parent4ba8cc856bd2d11f3c500a27bca7b56d826a19b6 (diff)
downloadlibxml2-fb2f518cc61239a4010612c9307a3fd7d13c996c.tar.gz
Fix potential infinite loop in xmlStringLenDecodeEntities
Make sure that xmlParseStringPEReference advances the "str" pointer even if the parser was stopped. Otherwise xmlStringLenDecodeEntities can loop infinitely.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/parser.c b/parser.c
index 781aa0c5..1e23d26a 100644
--- a/parser.c
+++ b/parser.c
@@ -8327,6 +8327,7 @@ xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) {
entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
if (ctxt->instate == XML_PARSER_EOF) {
xmlFree(name);
+ *str = ptr;
return(NULL);
}
if (entity == NULL) {