mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 20:55:13 +02:00
xt_geoip: do not throw a warnings when country database is size 0
This commit is contained in:
@@ -3,6 +3,7 @@ HEAD
|
||||
====
|
||||
Fixes:
|
||||
- xt_RAWNAT: ensure correct operation in the presence of IPv4 options
|
||||
- xt_geoip: do not throw a warnings when country database is size 0
|
||||
|
||||
|
||||
v2.2 (2013-03-31)
|
||||
|
@@ -83,10 +83,18 @@ geoip_add_node(const struct geoip_country_user __user *umem_ptr,
|
||||
p->count = umem.count;
|
||||
p->cc = umem.cc;
|
||||
size = p->count * geoproto_size[proto];
|
||||
subnet = vmalloc(size);
|
||||
if (subnet == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto free_p;
|
||||
if (size == 0) {
|
||||
/*
|
||||
* Believe it or not, vmalloc prints a warning to dmesg for
|
||||
* zero-sized allocations :-/
|
||||
*/
|
||||
subnet = NULL;
|
||||
} else {
|
||||
subnet = vmalloc(size);
|
||||
if (subnet == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto free_p;
|
||||
}
|
||||
}
|
||||
if (copy_from_user(subnet,
|
||||
(const void __user *)(unsigned long)umem.subnets, size) != 0) {
|
||||
|
Reference in New Issue
Block a user