1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-14 20:01:04 +03:00

fix an HTML parsing error on large data sections reported by Mike Day add

* HTMLparser.c: fix an HTML parsing error on large data sections
  reported by Mike Day
* test/HTML/utf8bug.html result/HTML/utf8bug.html.err
  result/HTML/utf8bug.html.sax result/HTML/utf8bug.html: add the
  reproducer to the test suite
daniel

svn path=/trunk/; revision=3797
This commit is contained in:
Daniel Veillard
2008-09-25 16:06:18 +00:00
parent 2e36da9f6f
commit a57ba4ce96
6 changed files with 1132 additions and 0 deletions

View File

@ -2768,6 +2768,7 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) {
xmlChar buf[HTML_PARSER_BIG_BUFFER_SIZE + 5];
int nbchar = 0;
int cur, l;
int chunk = 0;
SHRINK;
cur = CUR_CHAR(l);
@ -2798,6 +2799,12 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) {
nbchar = 0;
}
NEXTL(l);
chunk++;
if (chunk > HTML_PARSER_BUFFER_SIZE) {
chunk = 0;
SHRINK;
GROW;
}
cur = CUR_CHAR(l);
if (cur == 0) {
SHRINK;