]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P2: Check ssid != NULL more consistently in wpas_p2p_invite()
authorJouni Malinen <j@w1.fi>
Sun, 23 Feb 2025 10:44:50 +0000 (12:44 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 23 Feb 2025 10:44:50 +0000 (12:44 +0200)
The recently added !ssid check here could make static analyzers complain
about dereferencing ssid in the function, so instead of covering just
the special P2P2 case, check explicitly for ssid == NULL for all cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/p2p_supplicant.c

index 107e21695ced0acf83af99f4bdeda33d5dca8f6e..b8add917a4fd6005a699b16482e1928bdb57654b 100644 (file)
@@ -8815,6 +8815,9 @@ int wpas_p2p_invite(struct wpa_supplicant *wpa_s, const u8 *peer_addr,
                }
        }
 
+       if (!ssid)
+               return -1;
+
        wpa_s->p2p_persistent_go_freq = freq;
        wpa_s->p2p_go_ht40 = !!ht40;
        wpa_s->p2p_go_vht = !!vht;