From: Alvaro Neira Ayuso <alvaroneay@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: [libnftnl PATCH] ruleset: crash in path error when we build the xml tree
Date: Tue, 24 Feb 2015 09:10:33 +0100 [thread overview]
Message-ID: <1424765433-4975-2-git-send-email-alvaroneay@gmail.com> (raw)
In-Reply-To: <1424765433-4975-1-git-send-email-alvaroneay@gmail.com>
Crash when we try to release a tree that is not initialized.
Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
---
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
next prev parent reply other threads:[~2015-02-24 8:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-24 8:10 [libnftnl PATCH v3] ruleset: fix crash if we free sets included in the set_list Alvaro Neira Ayuso
2015-02-24 8:10 ` Alvaro Neira Ayuso [this message]
2015-02-24 13:43 ` [libnftnl PATCH] ruleset: crash in path error when we build the xml tree Pablo Neira Ayuso
2015-02-24 13:47 ` [libnftnl PATCH v3] ruleset: fix crash if we free sets included in the set_list Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1424765433-4975-2-git-send-email-alvaroneay@gmail.com \
--to=alvaroneay@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).