mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
malloc-fail: Add error check in htmlParseHTMLAttribute
This function must return NULL is an error occurs. Found by OSS-Fuzz, see #344.
This commit is contained in:
@@ -2844,6 +2844,10 @@ htmlParseHTMLAttribute(htmlParserCtxtPtr ctxt, const xmlChar stop) {
|
||||
out = &buffer[indx];
|
||||
}
|
||||
c = CUR_CHAR(l);
|
||||
if (ctxt->instate == XML_PARSER_EOF) {
|
||||
xmlFree(buffer);
|
||||
return(NULL);
|
||||
}
|
||||
if (c < 0x80)
|
||||
{ *out++ = c; bits= -6; }
|
||||
else if (c < 0x800)
|
||||
|
||||
Reference in New Issue
Block a user