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

entities: Don't allow null name in xmlNewEntity

This commit is contained in:
Nick Wellnhofer 2024-03-05 18:07:13 +01:00
parent 50816b8d1a
commit edbf1eb63b

View File

@ -395,6 +395,8 @@ xmlNewEntity(xmlDocPtr doc, const xmlChar *name, int type,
if ((doc != NULL) && (doc->intSubset != NULL)) {
return(xmlAddDocEntity(doc, name, type, ExternalID, SystemID, content));
}
if (name == NULL)
return(NULL);
return(xmlCreateEntity(doc, name, type, ExternalID, SystemID, content));
}