mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-02-06 05:57:39 +03:00
malloc-fail: Fix use-after-free in xmlXIncludeAddNode
Found with libFuzzer, see #344.
This commit is contained in:
parent
afc7e3a7f4
commit
5a19e21605
@ -555,14 +555,15 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) {
|
||||
}
|
||||
URL = xmlSaveUri(uri);
|
||||
xmlFreeURI(uri);
|
||||
xmlFree(URI);
|
||||
if (URL == NULL) {
|
||||
xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI,
|
||||
"invalid value URI %s\n", URI);
|
||||
if (fragment != NULL)
|
||||
xmlFree(fragment);
|
||||
xmlFree(URI);
|
||||
return(NULL);
|
||||
}
|
||||
xmlFree(URI);
|
||||
|
||||
if (xmlStrEqual(URL, ctxt->doc->URL))
|
||||
local = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user