]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
xml: Add Value node in TNDS node conversion for empty value case
authorJouni Malinen <jouni@qca.qualcomm.com>
Sun, 26 Mar 2017 09:39:34 +0000 (12:39 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 26 Mar 2017 18:13:21 +0000 (21:13 +0300)
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 <jouni@qca.qualcomm.com>
src/utils/xml-utils.c

index 4916d29765f913594b721607bfc611ef53398793..a37a92d44e7bbf4518fa63333b488766f9b92e82 100644 (file)
@@ -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);