From: Jouni Malinen Date: Sun, 26 Mar 2017 09:39:34 +0000 (+0300) Subject: xml: Add Value node in TNDS node conversion for empty value case X-Git-Tag: hostap_2_7~1427 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2f00bb5ff5243024a2809dba2f264ea3714583e;p=thirdparty%2Fhostap.git xml: Add Value node in TNDS node conversion for empty value case Previously, the Value node was not added if value of a node could not be fetched. This can cause interoperability issues, so address that in the same way as an empty length value, i.e., by adding a Value node with zero-length contents. Signed-off-by: Jouni Malinen --- diff --git a/src/utils/xml-utils.c b/src/utils/xml-utils.c index 4916d2976..a37a92d44 100644 --- a/src/utils/xml-utils.c +++ b/src/utils/xml-utils.c @@ -246,10 +246,8 @@ static void node_to_tnds(struct xml_node_ctx *ctx, xml_node_t *out, xml_node_create_text(ctx, tnds, NULL, "Path", uri); val = get_val(ctx, node); - if (val) { - xml_node_create_text(ctx, tnds, NULL, "Value", val); - xml_node_get_text_free(ctx, val); - } + xml_node_create_text(ctx, tnds, NULL, "Value", val ? val : ""); + xml_node_get_text_free(ctx, val); new_uri = add_path(uri, name); node_to_tnds(ctx, new_uri ? out : tnds, node, new_uri);