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

valid: Check for elem->name in xmlIsID

elem->name can be NULL is xmlNodeSetDoc failed.
This commit is contained in:
Nick Wellnhofer 2024-03-14 20:49:39 +01:00
parent 1233805dcb
commit af3d80b9a0

View File

@ -2499,7 +2499,9 @@ xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {
((doc->intSubset == NULL) && (doc->extSubset == NULL)))
return(0);
if ((elem == NULL) || (elem->type != XML_ELEMENT_NODE))
if ((elem == NULL) ||
(elem->type != XML_ELEMENT_NODE) ||
(elem->name == NULL))
return(0);
fullelemname = (elem->ns != NULL && elem->ns->prefix != NULL) ?