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

valid: Check for NULL node->name in xmlSnprintfElements

Unfortunately, we can have NULL element names if xmlSetTreeDoc fails.
This commit is contained in:
Nick Wellnhofer 2024-03-19 17:06:07 +01:00
parent a279aae30f
commit 577e2516d0

View File

@ -5020,7 +5020,8 @@ xmlSnprintfElements(char *buf, int size, xmlNodePtr node, int glob) {
strcat(buf, " ...");
return;
}
strcat(buf, (char *) cur->name);
if (cur->name != NULL)
strcat(buf, (char *) cur->name);
if (cur->next != NULL)
strcat(buf, " ");
break;