1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-28 00:21:53 +03:00

avoid stopping parsing when encountering out of range characters in an

* HTMLparser.c: avoid stopping parsing when encountering
  out of range characters in an HTML file, report and 
  continue processing instead, should fix #472696
Daniel

svn path=/trunk/; revision=3675
This commit is contained in:
Daniel Veillard
2008-01-11 07:41:39 +00:00
parent 9ebb632238
commit c5b43cc03a
2 changed files with 13 additions and 2 deletions

View File

@ -2772,8 +2772,13 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) {
cur = CUR_CHAR(l);
while (((cur != '<') || (ctxt->token == '<')) &&
((cur != '&') || (ctxt->token == '&')) &&
(IS_CHAR(cur))) {
COPY_BUF(l,buf,nbchar,cur);
(cur != 0)) {
if (!(IS_CHAR(cur))) {
htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
"Invalid char in CDATA 0x%X\n", cur);
} else {
COPY_BUF(l,buf,nbchar,cur);
}
if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) {
/*
* Ok the segment is to be consumed as chars.