netfilter: x_tables: add counters allocation wrapper
allows to have size checks in a single spot. This is supposed to reduce oom situations when fuzz-testing xtables. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:

committed by
Pablo Neira Ayuso

parent
9d5c12a7c0
commit
c84ca954ac
@@ -1063,7 +1063,7 @@ __do_replace(struct net *net, const char *name, unsigned int valid_hooks,
|
||||
struct ip6t_entry *iter;
|
||||
|
||||
ret = 0;
|
||||
counters = vzalloc(num_counters * sizeof(struct xt_counters));
|
||||
counters = xt_counters_alloc(num_counters);
|
||||
if (!counters) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user