mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
malloc-fail: Fix buffer overread after htmlParseScript
Found by OSS-Fuzz, see #344.
This commit is contained in:
@@ -3139,6 +3139,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
|
||||
htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
|
||||
"Invalid char in CDATA 0x%X\n", cur);
|
||||
}
|
||||
NEXTL(l);
|
||||
if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) {
|
||||
buf[nbchar] = 0;
|
||||
if (ctxt->sax->cdataBlock!= NULL) {
|
||||
@@ -3152,7 +3153,6 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
|
||||
nbchar = 0;
|
||||
SHRINK;
|
||||
}
|
||||
NEXTL(l);
|
||||
cur = CUR_CHAR(l);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user