mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-10-26 12:25:09 +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:
parent
c81d0d04bf
commit
62f199ed7d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user