Blame test/recurse/lol4.patch

Packit Service a31ea6
Index: parser.c
Packit Service a31ea6
===================================================================
Packit Service a31ea6
--- parser.c	(revision 3773)
Packit Service a31ea6
+++ parser.c	(working copy)
Packit Service a31ea6
@@ -2505,6 +2505,11 @@ xmlStringLenDecodeEntities(xmlParserCtxt
Packit Service a31ea6
 	    c = CUR_SCHAR(str, l);
Packit Service a31ea6
 	else
Packit Service a31ea6
 	    c = 0;
Packit Service a31ea6
+        if ((nbchars > 500000) &&
Packit Service a31ea6
+	    (ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE)) {
Packit Service a31ea6
+	    xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
Packit Service a31ea6
+	    goto int_error;
Packit Service a31ea6
+        }
Packit Service a31ea6
     }
Packit Service a31ea6
     buffer[nbchars++] = 0;
Packit Service a31ea6
     return(buffer);