From 39e7f387f8ed546b28dfb03221ded4e3470e88a2 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Wed, 5 Feb 2020 12:08:20 +0100 Subject: [PATCH] XML namespace merge bug fixed. Example: two xmlns attributes could both survive a merge whereas one should replace the other. --- CHANGELOG.md | 2 ++ lib/src/clixon_xml_map.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92519821..3bdc3789 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ ### Corrected Bugs +* XML namespace merge bug fixed. Example: two xmlns attributes could both survive a merge whereas one should replace the other. + ## 4.3.1 (2 February 2020) Patch release based on testing by Dave Cornejo, Netgate diff --git a/lib/src/clixon_xml_map.c b/lib/src/clixon_xml_map.c index 504cf685..72d5d9f1 100644 --- a/lib/src/clixon_xml_map.c +++ b/lib/src/clixon_xml_map.c @@ -1216,7 +1216,7 @@ check_namespaces(cxobj *x0, /* source */ } else{ /* No, namespace does not exist in x1 _parent_ * Check if it is exists in x1 itself */ - if (nscache_get_prefix(x1, namespace, &pexist) == 1){ + if (xml2prefix(x1, namespace, &pexist) == 1){ /* Yes it exists, but is it equal? */ if ((pexist == NULL && prefix0 == NULL) || (pexist && prefix0 &&