提交 da2f27e9 编写于 作者: C Christophe Leroy 提交者: Pablo Neira Ayuso

netfilter: nf_conntrack_sip: fix wrong memory initialisation

In commit 82de0be6 ("netfilter: Add helper array
register/unregister functions"),
struct nf_conntrack_helper sip[MAX_PORTS][4] was changed to
sip[MAX_PORTS * 4], so the memory init should have been changed to
memset(&sip[4 * i], 0, 4 * sizeof(sip[i]));

But as the sip[] table is allocated in the BSS, it is already set to 0

Fixes: 82de0be6 ("netfilter: Add helper array register/unregister functions")
Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 29e09229
...@@ -1628,8 +1628,6 @@ static int __init nf_conntrack_sip_init(void) ...@@ -1628,8 +1628,6 @@ static int __init nf_conntrack_sip_init(void)
ports[ports_c++] = SIP_PORT; ports[ports_c++] = SIP_PORT;
for (i = 0; i < ports_c; i++) { for (i = 0; i < ports_c; i++) {
memset(&sip[i], 0, sizeof(sip[i]));
nf_ct_helper_init(&sip[4 * i], AF_INET, IPPROTO_UDP, "sip", nf_ct_helper_init(&sip[4 * i], AF_INET, IPPROTO_UDP, "sip",
SIP_PORT, ports[i], i, sip_exp_policy, SIP_PORT, ports[i], i, sip_exp_policy,
SIP_EXPECT_MAX, SIP_EXPECT_MAX,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册