diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2020-12-18 00:55:00 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2020-12-18 14:10:59 +0100 |
commit | 1d73f07d67e32d8eaccd85bc46c5d277a1dc00c9 (patch) | |
tree | c4d02114b0d7dc4af1c8885f893bd1b099585b50 /tree.c | |
parent | e2b975c317ae9cb672be459a4ff8761aedb3157c (diff) | |
download | libxml2-1d73f07d67e32d8eaccd85bc46c5d277a1dc00c9.tar.gz |
Fix null deref in xmlStringGetNodeList
Check for malloc failure to avoid null deref.
Found with libFuzzer.
Diffstat (limited to 'tree.c')
-rw-r--r-- | tree.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) { |