its: Fix NULL dereference (regression 2024-10-01).

* gettext-tools/src/its.c (_its_copy_node_with_attributes): Handle attributes
without namespace correctly.
This commit is contained in:
Bruno Haible 2024-10-11 22:30:09 +02:00
parent 376beb46f0
commit c0e43492f3

View File

@ -1989,7 +1989,9 @@ _its_copy_node_with_attributes (xmlNode *node)
if (strcmp ((const char *) attr_name, "id") != 0)
{
xmlNs *attr_ns = attributes->ns;
xmlChar *attr_value = xmlGetNsProp (node, attr_name, attr_ns->href);
xmlChar *attr_value =
xmlGetNsProp (node, attr_name,
attr_ns != NULL ? attr_ns->href : NULL);
xmlNewNsProp (copy, attr_ns, attr_name, attr_value);
xmlFree (attr_value);
}