Permalink
Browse files

614005 Possible erroneous HTML parsing on unterminated script

Fix a nasty error handling problem when an error happen at the
end of the input buffer.
  • Loading branch information...
1 parent 37072b7 commit d4b54471417878a6d06e79e43a4f7afb7ba69fdd @pierrebelzile pierrebelzile committed with veillard Nov 4, 2010
Showing with 5 additions and 3 deletions.
  1. +5 −3 HTMLparser.c
View
8 HTMLparser.c
@@ -2887,9 +2887,11 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
}
if ((!(IS_CHAR_CH(cur))) && (!((cur == 0) && (ctxt->progressive)))) {
- htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
- "Invalid char in CDATA 0x%X\n", cur);
- NEXT;
+ htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+ "Invalid char in CDATA 0x%X\n", cur);
+ if (ctxt->input->cur < ctxt->input->end) {
+ NEXT;
+ }
}
if ((nbchar != 0) && (ctxt->sax != NULL) && (!ctxt->disableSAX)) {

0 comments on commit d4b5447

Please sign in to comment.