wg-quick: android: do not choke on empty allowed-ips

Reported-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-11-11 22:11:56 -05:00
parent 1aa8364b17
commit 7e106d3a4c

View file

@ -512,10 +512,13 @@ static void set_routes(const char *iface, unsigned int netid)
if (!start) if (!start)
continue; continue;
++start; ++start;
for (char *allowedip = strtok(start, " \n"); allowedip; allowedip = strtok(NULL, " \n")) for (char *allowedip = strtok(start, " \n"); allowedip; allowedip = strtok(NULL, " \n")) {
if (!strcmp(allowedip, "(none)"))
continue;
add_route(iface, netid, allowedip); add_route(iface, netid, allowedip);
} }
} }
}
static void maybe_block_ipv6(const char *iface) static void maybe_block_ipv6(const char *iface)
{ {