From 07315b6fdb2566a8626d8a1e4de76eb30456fe17 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 16 Oct 2019 16:40:41 +0200 Subject: [PATCH] nl80211: handle hidden SSIDs in wpa_supplicant scan results Signed-off-by: Jo-Philipp Wich --- iwinfo_nl80211.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index c7b0222..4b6ef91 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -2560,7 +2560,7 @@ static int nl80211_get_scanlist_wpactl(const char *ifname, char *buf, int *len) flags = strtok(NULL, "\t"); ssid = strtok(NULL, "\n"); - if (!bssid || !freq || !signal || !flags || !ssid) + if (!bssid || !freq || !signal || !flags) continue; /* BSSID */ @@ -2572,7 +2572,10 @@ static int nl80211_get_scanlist_wpactl(const char *ifname, char *buf, int *len) e->mac[5] = strtol(&bssid[15], NULL, 16); /* SSID */ - wpasupp_ssid_decode(ssid, e->ssid, sizeof(e->ssid)); + if (ssid) + wpasupp_ssid_decode(ssid, e->ssid, sizeof(e->ssid)); + else + e->ssid[0] = 0; /* Mode */ if (strstr(flags, "[MESH]")) -- 2.25.1