diff --git a/ChangeLog b/ChangeLog index bc2e78e1..fff87cb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Oct 16 11:32:09 CEST 2006 Daniel Veillard + + * HTMLparser.c: fix a chunking and script bug #347708 + Mon Oct 16 09:51:05 CEST 2006 Daniel Veillard * HTMLparser.c: remove a warning diff --git a/HTMLparser.c b/HTMLparser.c index 3e5d813e..946e807d 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -2707,7 +2707,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) { cur = CUR_CHAR(l); } - if (!(IS_CHAR_CH(cur))) { + if ((!(IS_CHAR_CH(cur))) && (!((cur == 0) && (ctxt->progressive)))) { htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR, "Invalid char in CDATA 0x%X\n", cur); NEXT; @@ -4940,9 +4940,17 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { /* * Handle SCRIPT/STYLE separately */ - if ((!terminate) && - (htmlParseLookupSequence(ctxt, '<', '/', 0, 0) < 0)) - goto done; + if (!terminate) { + int idx; + xmlChar val; + + idx = htmlParseLookupSequence(ctxt, '<', '/', 0, 0); + if (idx < 0) + goto done; + val = in->cur[idx + 2]; + if (val == 0) /* bad cut of input */ + goto done; + } htmlParseScript(ctxt); if ((cur == '<') && (next == '/')) { ctxt->instate = XML_PARSER_END_TAG; @@ -5380,6 +5388,7 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data, xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size); #endif } + ctxt->progressive = 1; return(ctxt); }