From 577e2516d0ed3669c7e9879ba9f04214658bfd1b Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Tue, 19 Mar 2024 17:06:07 +0100 Subject: [PATCH] valid: Check for NULL node->name in xmlSnprintfElements Unfortunately, we can have NULL element names if xmlSetTreeDoc fails. --- valid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- libxml2-2.12.7+dfsg+really2.9.14.orig/valid.c +++ libxml2-2.12.7+dfsg+really2.9.14/valid.c @@ -5274,7 +5274,8 @@ xmlSnprintfElements(char *buf, int size, strcat(buf, " ..."); return; } - strcat(buf, (char *) cur->name); + if (cur->name != NULL) + strcat(buf, (char *) cur->name); if (cur->next != NULL) strcat(buf, " "); break;