From: Bruno Haible Date: Fri, 11 Oct 2024 20:30:09 +0000 (+0200) Subject: its: Fix NULL dereference (regression 2024-10-01). X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c0e43492f39e371c2fc9dad9818df74c0cda835c;p=thirdparty%2Fgettext.git its: Fix NULL dereference (regression 2024-10-01). * gettext-tools/src/its.c (_its_copy_node_with_attributes): Handle attributes without namespace correctly. --- diff --git a/gettext-tools/src/its.c b/gettext-tools/src/its.c index 0aabb6e9a..66c964b7e 100644 --- a/gettext-tools/src/its.c +++ b/gettext-tools/src/its.c @@ -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); }