Patchwork [stable-3.7] netfilter: xt_CT: fix unset return value if conntrack zone are disabled

login
register
mail settings
Submitter Pablo Neira
Date Feb. 1, 2013, 5:18 p.m.
Message ID <1359739097-5389-1-git-send-email-pablo@netfilter.org>
Download mbox | patch
Permalink /patch/217527/
State Accepted
Headers show

Comments

Pablo Neira - Feb. 1, 2013, 5:18 p.m.
From: Pablo Neira Ayuso <pablo@netfilter.org>

net/netfilter/xt_CT.c: In function ‘xt_ct_tg_check_v1’:
net/netfilter/xt_CT.c:250:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
net/netfilter/xt_CT.c: In function ‘xt_ct_tg_check_v0’:
net/netfilter/xt_CT.c:112:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]

[ You can cherry-pick from 4610476 netfilter: xt_CT: fix unset return value if conntrack zone are disabled ]

Reported-by: Borislav Petkov <bp@alien8.de>
Acked-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/xt_CT.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c
index aeeaf5c..8461605 100644
--- a/net/netfilter/xt_CT.c
+++ b/net/netfilter/xt_CT.c
@@ -109,7 +109,7 @@  static int xt_ct_tg_check_v0(const struct xt_tgchk_param *par)
 	struct xt_ct_target_info *info = par->targinfo;
 	struct nf_conntrack_tuple t;
 	struct nf_conn *ct;
-	int ret;
+	int ret = -EOPNOTSUPP;
 
 	if (info->flags & ~XT_CT_NOTRACK)
 		return -EINVAL;
@@ -243,7 +243,7 @@  static int xt_ct_tg_check_v1(const struct xt_tgchk_param *par)
 	struct xt_ct_target_info_v1 *info = par->targinfo;
 	struct nf_conntrack_tuple t;
 	struct nf_conn *ct;
-	int ret;
+	int ret = -EOPNOTSUPP;
 
 	if (info->flags & ~XT_CT_NOTRACK)
 		return -EINVAL;