1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-21 22:50:08 +03:00

Fix null deref in xmlStringGetNodeList

Check for malloc failure to avoid null deref.

Found with libFuzzer.
This commit is contained in:
Nick Wellnhofer 2020-12-18 00:55:00 +01:00
parent e2b975c317
commit 1d73f07d67

4
tree.c
View File

@ -1649,6 +1649,10 @@ xmlStringGetNodeList(const xmlDoc *doc, const xmlChar *value) {
if (!xmlBufIsEmpty(buf)) {
node = xmlNewDocText(doc, NULL);
if (node == NULL) {
xmlBufFree(buf);
return(NULL);
}
node->content = xmlBufDetach(buf);
if (last == NULL) {