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

applied UTF-8 script parsing bug #310229 fix from Jiri Netolicky added the

* HTMLparser.c: applied UTF-8 script parsing bug #310229 fix from
  Jiri Netolicky
* result/HTML/script2.html* test/HTML/script2.html: added the test
  case from the regression suite
Daniel
This commit is contained in:
Daniel Veillard
2005-07-13 16:37:38 +00:00
parent 744acfffe5
commit 358fef4b1e
6 changed files with 96 additions and 6 deletions

View File

@@ -2629,10 +2629,10 @@ static void
htmlParseScript(htmlParserCtxtPtr ctxt) {
xmlChar buf[HTML_PARSER_BIG_BUFFER_SIZE + 1];
int nbchar = 0;
xmlChar cur;
int cur,l;
SHRINK;
cur = CUR;
cur = CUR_CHAR(l);
while (IS_CHAR_CH(cur)) {
if ((cur == '<') && (NXT(1) == '!') && (NXT(2) == '-') &&
(NXT(3) == '-')) {
@@ -2648,7 +2648,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
}
nbchar = 0;
htmlParseComment(ctxt);
cur = CUR;
cur = CUR_CHAR(l);
continue;
} else if ((cur == '<') && (NXT(1) == '/')) {
/*
@@ -2661,7 +2661,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
((NXT(2) >= 'a') && (NXT(2) <= 'z')))
break; /* while */
}
buf[nbchar++] = cur;
COPY_BUF(l,buf,nbchar,cur);
if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) {
if (ctxt->sax->cdataBlock!= NULL) {
/*
@@ -2673,8 +2673,8 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
}
nbchar = 0;
}
NEXT;
cur = CUR;
NEXTL(l);
cur = CUR_CHAR(l);
}
if (!(IS_CHAR_CH(cur))) {
htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,