core: return error from parsing failure

If the XML document could not be parsed then `root_element` will come
out as NULL. Check this before trying to dereference it.

Signed-off-by: Richard Fuchs <dfx@dfx.at>
This commit is contained in:
Richard Fuchs 2024-01-27 09:04:22 -05:00 committed by Dirk Hohndel
parent fb41999c73
commit caf2f8c102

View file

@ -2348,6 +2348,9 @@ static xmlDoc *test_xslt_transforms(xmlDoc *doc, const struct xml_params *params
xmlNode *root_element = xmlDocGetRootElement(doc);
xmlChar *attribute;
if (!root_element)
return NULL;
while (info->root) {
if ((strcasecmp((const char *)root_element->name, info->root) == 0)) {
if (info->attribute == NULL)