[libnftnl PATCH] ruleset: crash in path error when we build the xml tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Crash when we try to release a tree that is not initialized.

Signed-off-by: Alvaro Neira Ayuso <alvaroneay@xxxxxxxxx>
---
 src/ruleset.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ruleset.c b/src/ruleset.c
index 9e8965c..8549130 100644
--- a/src/ruleset.c
+++ b/src/ruleset.c
@@ -669,8 +669,10 @@ static int nft_ruleset_xml_parse(const void *xml, struct nft_parse_err *err,
 		nft_ruleset_ctx_set(&ctx, NFT_RULESET_CTX_DATA, arg);
 
 	tree = nft_mxml_build_tree(xml, "nftables", err, input);
-	if (tree == NULL)
-		goto err;
+	if (tree == NULL) {
+		nft_set_list_free(ctx.set_list);
+		return -1;
+	}
 
 	ctx.xml = tree;
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux