Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77b4311d authored by Jozsef Kadlecsik's avatar Jozsef Kadlecsik Committed by Pablo Neira Ayuso
Browse files

netfilter: ipset: Allocate the proper size of memory when /0 networks are supported

parent 25a76f34
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1101,8 +1101,7 @@ IPSET_TOKEN(HTYPE, _create)(struct net *net, struct ip_set *set,

	hsize = sizeof(*h);
#ifdef IP_SET_HASH_WITH_NETS
	hsize += sizeof(struct net_prefixes) *
		(set->family == NFPROTO_IPV4 ? 32 : 128);
	hsize += sizeof(struct net_prefixes) * NLEN(set->family);
#endif
	h = kzalloc(hsize, GFP_KERNEL);
	if (!h)