From: Alvaro Neira Date: Mon, 2 Mar 2015 19:58:38 +0000 (+0100) Subject: xml: test if the root node name is initialized X-Git-Tag: libnftnl-1.0.4~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bb1fdcbea31a3e774dda646f2aeecaa7ea1ef51;p=thirdparty%2Flibnftnl.git xml: test if the root node name is initialized If the root node name is missing, we have a crash. Signed-off-by: Alvaro Neira Ayuso Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/mxml.c b/src/mxml.c index 0001ba0e..b68f86f4 100644 --- a/src/mxml.c +++ b/src/mxml.c @@ -43,7 +43,8 @@ mxml_node_t *nft_mxml_build_tree(const void *data, const char *treename, goto err; } - if (strcmp(tree->value.opaque, treename) == 0) + if (tree->value.opaque != NULL && + strcmp(tree->value.opaque, treename) == 0) return tree; err->error = NFT_PARSE_EMISSINGNODE;