path: root/src/mxml.c
diff options
authorPablo Neira Ayuso <>2013-07-25 21:58:33 +0200
committerPablo Neira Ayuso <>2013-07-25 22:03:36 +0200
commitf57644702ddc427dfafc728fb25085158e93504a (patch)
treea80393cf01fb254ecfc6ad2b1ff93e7c966bbc4f /src/mxml.c
parentbe9019acf97391d58838e3c21fe7db9cfc27b5f9 (diff)
mxml: nft_mxml_str_parse returns copy of the string
Otherwise, the string points to an invalid memory position somewhere in the XML tree that is released after the parsing. This problem was there before the conversion to the new helper function nft_mxml_str_parse. Reported-by: Arturo Borrero <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'src/mxml.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mxml.c b/src/mxml.c
index e8d4b86..f812bf6 100644
--- a/src/mxml.c
+++ b/src/mxml.c
@@ -162,7 +162,7 @@ const char *nft_mxml_str_parse(mxml_node_t *tree, const char *node_name,
return NULL;
- return node->child->value.opaque;
+ return strdup(node->child->value.opaque);