fix loop in HTMLparser.c

This commit is contained in:
William M. Brack 2001-09-23 01:55:08 +00:00
parent b1d62871db
commit d28e48ab49
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Sat Sep 22 10:00:00 HKT 2001 William Brack <wbrack@mmm.com.hk>
* HTMLparser.c: small enhancement to prevent loop on
unrecognizable data
Fri Sep 21 11:45:53 CEST 2001 Daniel Veillard <daniel@veillard.com>
* parserInternals.c: applying patch from bug #60757 this

View File

@ -3394,6 +3394,7 @@ htmlParseElement(htmlParserCtxtPtr ctxt) {
htmlParserNodeInfo node_info;
xmlChar *oldname;
int depth = ctxt->nameNr;
xmlChar *oldptr;
/* Capture start position */
if (ctxt->record_info) {
@ -3516,7 +3517,9 @@ htmlParseElement(htmlParserCtxtPtr ctxt) {
currentNode = xmlStrdup(ctxt->name);
depth = ctxt->nameNr;
while (IS_CHAR(CUR)) {
oldptr = ctxt->input->cur;
htmlParseContent(ctxt);
if (oldptr==ctxt->input->cur) break;
if (ctxt->nameNr < depth) break;
}