From c0e43492f39e371c2fc9dad9818df74c0cda835c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 11 Oct 2024 22:30:09 +0200 Subject: [PATCH] its: Fix NULL dereference (regression 2024-10-01). * gettext-tools/src/its.c (_its_copy_node_with_attributes): Handle attributes without namespace correctly. --- gettext-tools/src/its.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- 2.47.2