mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-13 13:17:36 +03:00
malloc-fail: Fix null deref in xmlSchemaParseWildcardNs
Found with libFuzzer, see #344.
This commit is contained in:
parent
ba290a8663
commit
e15838ab54
@ -6858,6 +6858,8 @@ xmlSchemaParseWildcardNs(xmlSchemaParserCtxtPtr ctxt,
|
|||||||
*/
|
*/
|
||||||
attr = xmlSchemaGetPropNode(node, "namespace");
|
attr = xmlSchemaGetPropNode(node, "namespace");
|
||||||
ns = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
|
ns = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
|
||||||
|
if (ns == NULL)
|
||||||
|
return (-1);
|
||||||
if ((attr == NULL) || (xmlStrEqual(ns, BAD_CAST "##any")))
|
if ((attr == NULL) || (xmlStrEqual(ns, BAD_CAST "##any")))
|
||||||
wildc->any = 1;
|
wildc->any = 1;
|
||||||
else if (xmlStrEqual(ns, BAD_CAST "##other")) {
|
else if (xmlStrEqual(ns, BAD_CAST "##other")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user