mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
fb41999c73
commit
caf2f8c102
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue