diff mbox

[next] netfilter: ctnetlink: fix uninitialized variable

Message ID 1377596846-1790-1-git-send-email-fw@strlen.de
State Accepted
Headers show

Commit Message

Florian Westphal Aug. 27, 2013, 9:47 a.m. UTC
net/netfilter/nf_conntrack_netlink.c: In function 'ctnetlink_nfqueue_attach_expect':
'helper' may be used uninitialized in this function

It was only initialized in if CTA_EXPECT_HELP_NAME attribute was
present, it must be NULL otherwise.

Problem added recently in bd077937
(netfilter: nfnetlink_queue: allow to attach expectations to conntracks).

Signed-off-by: Florian Westphal <fw@strlen.de>
---

Comments

Pablo Neira Ayuso Aug. 27, 2013, 10:51 p.m. UTC | #1
On Tue, Aug 27, 2013 at 11:47:26AM +0200, Florian Westphal wrote:
> net/netfilter/nf_conntrack_netlink.c: In function 'ctnetlink_nfqueue_attach_expect':
> 'helper' may be used uninitialized in this function
>
> It was only initialized in if CTA_EXPECT_HELP_NAME attribute was
> present, it must be NULL otherwise.
> 
> Problem added recently in bd077937
> (netfilter: nfnetlink_queue: allow to attach expectations to conntracks).

Applied, thanks Florian!
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index fa61fea..1f4ffa2 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -2170,7 +2170,7 @@  ctnetlink_nfqueue_attach_expect(const struct nlattr *attr, struct nf_conn *ct,
 {
 	struct nlattr *cda[CTA_EXPECT_MAX+1];
 	struct nf_conntrack_tuple tuple, mask;
-	struct nf_conntrack_helper *helper;
+	struct nf_conntrack_helper *helper = NULL;
 	struct nf_conntrack_expect *exp;
 	int err;