summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-09-22 17:58:03 +0200
committerJo-Philipp Wich <jo@mein.io>2019-09-22 18:12:47 +0200
commita76675136938c120e55a52c86fd89683486dc78c (patch)
tree290a72e0348b5275815fff1c5fa3bf892ad32d78
parentf096bfd317aef4c66b16f2a57f0bf6b96e3f562c (diff)
downloadiwinfo-a76675136938c120e55a52c86fd89683486dc78c.tar.gz
nl80211: fix parsing of mixed wpa encryption in wpa_supp scan results
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--iwinfo_nl80211.c4
1 files 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;