diff options
| author | Florent Fourcot <florent.fourcot@wifirst.fr> | 2019-06-10 06:28:58 -0400 |
|---|---|---|
| committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2019-06-10 06:29:31 -0400 |
| commit | 24c509b2e2f1661ce9500fc7e32647113e62d7e3 (patch) | |
| tree | 4e5a26f1d5ef2a0d8fd003ee5464f3fbc6fa366f | |
| parent | 16e6427c88c5b7e7b6612f6c286d5f71d659e5be (diff) | |
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>
| -rw-r--r-- | net/netfilter/ipset/ip_set_core.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c index 3f4a4936f63c..faddcf398b73 100644 --- a/net/netfilter/ipset/ip_set_core.c +++ b/net/netfilter/ipset/ip_set_core.c | |||
| @@ -1599,7 +1599,6 @@ static int ip_set_uadd(struct net *net, struct sock *ctnl, struct sk_buff *skb, | |||
| 1599 | int nla_rem; | 1599 | int nla_rem; |
| 1600 | 1600 | ||
| 1601 | nla_for_each_nested(nla, attr[IPSET_ATTR_ADT], nla_rem) { | 1601 | nla_for_each_nested(nla, attr[IPSET_ATTR_ADT], nla_rem) { |
| 1602 | memset(tb, 0, sizeof(tb)); | ||
| 1603 | if (nla_type(nla) != IPSET_ATTR_DATA || | 1602 | if (nla_type(nla) != IPSET_ATTR_DATA || |
| 1604 | !flag_nested(nla) || | 1603 | !flag_nested(nla) || |
| 1605 | nla_parse_nested_deprecated(tb, IPSET_ATTR_ADT_MAX, nla, set->type->adt_policy, NULL)) | 1604 | 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, | |||
| 1651 | int nla_rem; | 1650 | int nla_rem; |
| 1652 | 1651 | ||
| 1653 | nla_for_each_nested(nla, attr[IPSET_ATTR_ADT], nla_rem) { | 1652 | nla_for_each_nested(nla, attr[IPSET_ATTR_ADT], nla_rem) { |
| 1654 | memset(tb, 0, sizeof(*tb)); | ||
| 1655 | if (nla_type(nla) != IPSET_ATTR_DATA || | 1653 | if (nla_type(nla) != IPSET_ATTR_DATA || |
| 1656 | !flag_nested(nla) || | 1654 | !flag_nested(nla) || |
| 1657 | nla_parse_nested_deprecated(tb, IPSET_ATTR_ADT_MAX, nla, set->type->adt_policy, NULL)) | 1655 | nla_parse_nested_deprecated(tb, IPSET_ATTR_ADT_MAX, nla, set->type->adt_policy, NULL)) |
