Skip to content

Commit 24c509b

Browse files
ffourcotJozsef Kadlecsik
authored andcommitted
netfilter: ipset: remove useless memset() calls
One of the memset call is buggy: it does not erase full array, but only pointer size. Moreover, after a check, first step of nla_parse_nested/nla_parse is to erase tb array as well. We can remove both calls safely. Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr> Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
1 parent 16e6427 commit 24c509b

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

net/netfilter/ipset/ip_set_core.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,6 @@ static int ip_set_uadd(struct net *net, struct sock *ctnl, struct sk_buff *skb,
15991599
int nla_rem;
16001600

16011601
nla_for_each_nested(nla, attr[IPSET_ATTR_ADT], nla_rem) {
1602-
memset(tb, 0, sizeof(tb));
16031602
if (nla_type(nla) != IPSET_ATTR_DATA ||
16041603
!flag_nested(nla) ||
16051604
nla_parse_nested_deprecated(tb, IPSET_ATTR_ADT_MAX, nla, set->type->adt_policy, NULL))
@@ -1651,7 +1650,6 @@ static int ip_set_udel(struct net *net, struct sock *ctnl, struct sk_buff *skb,
16511650
int nla_rem;
16521651

16531652
nla_for_each_nested(nla, attr[IPSET_ATTR_ADT], nla_rem) {
1654-
memset(tb, 0, sizeof(*tb));
16551653
if (nla_type(nla) != IPSET_ATTR_DATA ||
16561654
!flag_nested(nla) ||
16571655
nla_parse_nested_deprecated(tb, IPSET_ATTR_ADT_MAX, nla, set->type->adt_policy, NULL))

0 commit comments

Comments
 (0)