Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Jozsef Kadlecsik and committed by
Pablo Neira Ayuso
77b4311d 25a76f34

+1 -2
+1 -2
net/netfilter/ipset/ip_set_hash_gen.h
··· 1101 1101 1102 1102 hsize = sizeof(*h); 1103 1103 #ifdef IP_SET_HASH_WITH_NETS 1104 - hsize += sizeof(struct net_prefixes) * 1105 - (set->family == NFPROTO_IPV4 ? 32 : 128); 1104 + hsize += sizeof(struct net_prefixes) * NLEN(set->family); 1106 1105 #endif 1107 1106 h = kzalloc(hsize, GFP_KERNEL); 1108 1107 if (!h)