summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2018-01-23 16:37:54 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2018-01-23 16:37:54 +0100
commit707ad080e61014ab4a6d60dc12875e233c1f673c (patch)
tree5166b89b172aa491ee6f504ffd4e8edb869c3587
parentab362ab0ad3af54406ae8237a525405c6e2a705b (diff)
downloadlibxml2-707ad080e61014ab4a6d60dc12875e233c1f673c.tar.gz
Fix xmlParserEntityCheck
A previous commit removed the check for XML_ERR_ENTITY_LOOP which is required to abort early in case of excessive entity recursion.
-rw-r--r--parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index 5e800e10..ca9fde2c 100644
--- a/parser.c
+++ b/parser.c
@@ -149,7 +149,7 @@ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size,
rep = xmlStringDecodeEntities(ctxt, ent->content,
XML_SUBSTITUTE_REF, 0, 0, 0);
--ctxt->depth;
- if (rep == NULL) {
+ if ((rep == NULL) || (ctxt->errNo == XML_ERR_ENTITY_LOOP)) {
ent->content[0] = 0;
}