nl80211: handle hidden SSIDs in wpa_supplicant scan results
authorJo-Philipp Wich <jo@mein.io>
Wed, 16 Oct 2019 14:40:41 +0000 (16:40 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 16 Oct 2019 14:41:55 +0000 (16:41 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
iwinfo_nl80211.c

index c7b0222e152485f4ca756edbca89d9ea10ba3057..4b6ef9124e66c6705b9ba356e8f2d8456b18f12a 100644 (file)
@@ -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]"))