1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-12 09:17:37 +03:00

malloc-fail: Fix null deref in xmlSchemaInitTypes

Found with libFuzzer, see #344.
This commit is contained in:
Nick Wellnhofer 2023-03-05 14:07:57 +01:00
parent cfbc1f48ee
commit 112340c6c0

View File

@ -404,6 +404,10 @@ xmlSchemaInitTypes(void)
xmlSchemaTypeAnyTypeDef = xmlSchemaInitBasicType("anyType",
XML_SCHEMAS_ANYTYPE,
NULL);
if (xmlSchemaTypeAnyTypeDef == NULL) {
xmlSchemaTypeErrMemory(NULL, NULL);
return;
}
xmlSchemaTypeAnyTypeDef->baseType = xmlSchemaTypeAnyTypeDef;
xmlSchemaTypeAnyTypeDef->contentType = XML_SCHEMA_CONTENT_MIXED;
/*