Commit dc476e7c8e7824fd326c79f50d7302faca7a4c2b
1 parent
f2020b27be
netfilter:ipset: Fix memory allocation for bitmap:port
At the restructuring of the bitmap types creation in ipset, for the bitmap:port type wrong (too large) memory allocation was copied (netfilter bugzilla id #859). Reported-by: Quentin Armitage <quentin@armitage.org.uk> Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
net/netfilter/ipset/ip_set_bitmap_port.c
... | ... | @@ -254,7 +254,7 @@ |
254 | 254 | return -ENOMEM; |
255 | 255 | |
256 | 256 | map->elements = last_port - first_port + 1; |
257 | - map->memsize = map->elements * sizeof(unsigned long); | |
257 | + map->memsize = bitmap_bytes(0, map->elements); | |
258 | 258 | set->variant = &bitmap_port; |
259 | 259 | set->dsize = ip_set_elem_len(set, tb, 0); |
260 | 260 | if (!init_map_port(set, map, first_port, last_port)) { |