From a76675136938c120e55a52c86fd89683486dc78c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 22 Sep 2019 17:58:03 +0200 Subject: [PATCH] nl80211: fix parsing of mixed wpa encryption in wpa_supp scan results Signed-off-by: Jo-Philipp Wich --- iwinfo_nl80211.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index 9855d88..5af3f9f 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -2185,11 +2185,11 @@ static int nl80211_get_txpwrlist(const char *ifname, char *buf, int *len) static void nl80211_get_scancrypto(char *spec, struct iwinfo_crypto_entry *c) { int wpa_version = 0; - char *p, *proto, *suites; + char *p, *q, *proto, *suites; c->enabled = 0; - for (p = strtok(spec, "[]"); p != NULL; p = strtok(NULL, "[]")) { + for (p = strtok_r(spec, "[]", &q); p; p = strtok_r(NULL, "[]", &q)) { if (!strcmp(p, "WEP")) { c->enabled = 1; c->auth_suites = IWINFO_KMGMT_NONE; -- 2.25.1