summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2023-03-05 14:10:08 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2023-03-08 13:17:48 +0100
commit31844c74df39c3b88735ef884c33c41da9d52795 (patch)
tree5f531f5f0c9aaed7fca0e85afc6ec889897fd2bb
parent9afb6c5fb86a0dca167b6ae60aa05211a25e435f (diff)
downloadlibxml2-31844c74df39c3b88735ef884c33c41da9d52795.tar.gz
malloc-fail: Fix null deref in xmlSchemaParseUnion
Found with libFuzzer, see #344.
-rw-r--r--xmlschemas.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xmlschemas.c b/xmlschemas.c
index 81cb0466..9d927cef 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -9017,6 +9017,8 @@ xmlSchemaParseUnion(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
xmlSchemaQNameRefPtr ref;
cur = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
+ if (cur == NULL)
+ return (-1);
type->base = cur;
do {
while (IS_BLANK_CH(*cur))