tests/handlers.c: Make accumulate_entity_decl robust towards value==NULL

This commit is contained in:
Sebastian Pipping 2023-10-27 01:06:25 +02:00
parent b0975cb73a
commit 7767efe1aa

View file

@ -1853,7 +1853,10 @@ accumulate_entity_decl(void *userData, const XML_Char *entityName,
UNUSED_P(notationName);
CharData_AppendXMLChars(storage, entityName, -1);
CharData_AppendXMLChars(storage, XCS("="), 1);
CharData_AppendXMLChars(storage, value, value_length);
if (value == NULL)
CharData_AppendXMLChars(storage, XCS("(null)"), -1);
else
CharData_AppendXMLChars(storage, value, value_length);
CharData_AppendXMLChars(storage, XCS("\n"), 1);
}