From 941bb3355d1882dab3d7f65e8b8bf2a5ae3b72be Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 11 Nov 2018 22:11:56 -0500 Subject: wg-quick: android: do not choke on empty allowed-ips Reported-by: Samuel Holland --- src/tools/wg-quick/android.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tools/wg-quick/android.c b/src/tools/wg-quick/android.c index e397664..e2b6abe 100644 --- a/src/tools/wg-quick/android.c +++ b/src/tools/wg-quick/android.c @@ -512,8 +512,11 @@ static void set_routes(const char *iface, unsigned int netid) if (!start) continue; ++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); + } } } -- cgit v1.2.3-59-g8ed1b