]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
its: Fix NULL dereference (regression 2024-10-01).
authorBruno Haible <bruno@clisp.org>
Fri, 11 Oct 2024 20:30:09 +0000 (22:30 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 11 Oct 2024 20:30:09 +0000 (22:30 +0200)
* gettext-tools/src/its.c (_its_copy_node_with_attributes): Handle attributes
without namespace correctly.

gettext-tools/src/its.c

index 0aabb6e9a5acc2ab609cd5c2e67007a97637bc09..66c964b7e74db23871aa6e43c30f468000126eb4 100644 (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);
         }