From 8c5e54d5bd042e7ac7ffd257f724477c332c535b Mon Sep 17 00:00:00 2001 From: Daniel Garcia Moreno Date: Tue, 18 Nov 2025 08:10:35 +0100 Subject: [PATCH] Fix C14N type confusion Do not try to get nsDef with xmlDoc Fix https://gitlab.gnome.org/GNOME/libxml2/-/issues/1016 --- c14n.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c14n.c b/c14n.c index 0057ae9aa..6d996d817 100644 --- a/c14n.c +++ b/c14n.c @@ -598,7 +598,7 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) } /* check all namespaces */ - for(n = cur; n != NULL; n = n->parent) { + for(n = cur; n != NULL && n->type == XML_ELEMENT_NODE; n = n->parent) { for(ns = n->nsDef; ns != NULL; ns = ns->next) { tmp = xmlSearchNs(cur->doc, cur, ns->prefix);