mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-10-26 12:25:09 +03:00
malloc-fail: Fix null deref in xmlXIncludeLoadTxt
Found with libFuzzer, see #344.
This commit is contained in:
parent
a3749551e6
commit
dc2dde1ab9
@ -1732,6 +1732,12 @@ xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, const xmlChar *url,
|
||||
xmlCharEncCloseFunc(buf->encoder);
|
||||
buf->encoder = xmlGetCharEncodingHandler(enc);
|
||||
node = xmlNewDocText(ctxt->doc, NULL);
|
||||
if (node == NULL) {
|
||||
xmlFreeInputStream(inputStream);
|
||||
xmlFreeParserCtxt(pctxt);
|
||||
xmlFree(URL);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Scan all chars from the resource and add the to the node
|
||||
|
Loading…
Reference in New Issue
Block a user