File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / libxml2 / test / recurse / lol4.patch
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:37:59 2012 UTC (12 years, 5 months ago) by misho
Branches: libxml2, MAIN
CVS tags: v2_9_1p0, v2_9_1, v2_8_0p0, v2_8_0, v2_7_8, HEAD
libxml2

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>