1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-25 23:21:26 +03:00

malloc-fail: Fix null deref in xmlSchemaParseWildcardNs

Found with libFuzzer, see #344.
This commit is contained in:
Nick Wellnhofer 2023-03-05 14:09:14 +01:00
parent ba290a8663
commit e15838ab54

View File

@ -6858,6 +6858,8 @@ xmlSchemaParseWildcardNs(xmlSchemaParserCtxtPtr ctxt,
*/
attr = xmlSchemaGetPropNode(node, "namespace");
ns = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
if (ns == NULL)
return (-1);
if ((attr == NULL) || (xmlStrEqual(ns, BAD_CAST "##any")))
wildc->any = 1;
else if (xmlStrEqual(ns, BAD_CAST "##other")) {