Tag
Hash :
0161e638
Author :
Date :
2008-08-28T15:36:32
completely different fix for the recursion detection based on entity * parser.c include/libxml/parser.h: completely different fix for the recursion detection based on entity density, big cleanups in the entity parsing code too * result/*.sax*: the parser should not ask for used defined versions of the predefined entities * testrecurse.c: automatic test for entity recursion checks * Makefile.am: added testrecurse * test/recurse/lol* test/recurse/good*: a first set of tests for the recursion Daniel svn path=/trunk/; revision=3783
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);