mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-12-25 23:21:26 +03:00
fix a chunking and script bug #347708 Daniel
* HTMLparser.c: fix a chunking and script bug #347708 Daniel
This commit is contained in:
parent
28aac0b0f4
commit
68716a772c
@ -1,3 +1,7 @@
|
|||||||
|
Mon Oct 16 11:32:09 CEST 2006 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* HTMLparser.c: fix a chunking and script bug #347708
|
||||||
|
|
||||||
Mon Oct 16 09:51:05 CEST 2006 Daniel Veillard <daniel@veillard.com>
|
Mon Oct 16 09:51:05 CEST 2006 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* HTMLparser.c: remove a warning
|
* HTMLparser.c: remove a warning
|
||||||
|
17
HTMLparser.c
17
HTMLparser.c
@ -2707,7 +2707,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
|
|||||||
cur = CUR_CHAR(l);
|
cur = CUR_CHAR(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(IS_CHAR_CH(cur))) {
|
if ((!(IS_CHAR_CH(cur))) && (!((cur == 0) && (ctxt->progressive)))) {
|
||||||
htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
|
htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
|
||||||
"Invalid char in CDATA 0x%X\n", cur);
|
"Invalid char in CDATA 0x%X\n", cur);
|
||||||
NEXT;
|
NEXT;
|
||||||
@ -4940,9 +4940,17 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
|
|||||||
/*
|
/*
|
||||||
* Handle SCRIPT/STYLE separately
|
* Handle SCRIPT/STYLE separately
|
||||||
*/
|
*/
|
||||||
if ((!terminate) &&
|
if (!terminate) {
|
||||||
(htmlParseLookupSequence(ctxt, '<', '/', 0, 0) < 0))
|
int idx;
|
||||||
goto done;
|
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);
|
htmlParseScript(ctxt);
|
||||||
if ((cur == '<') && (next == '/')) {
|
if ((cur == '<') && (next == '/')) {
|
||||||
ctxt->instate = XML_PARSER_END_TAG;
|
ctxt->instate = XML_PARSER_END_TAG;
|
||||||
@ -5380,6 +5388,7 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data,
|
|||||||
xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size);
|
xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
ctxt->progressive = 1;
|
||||||
|
|
||||||
return(ctxt);
|
return(ctxt);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user