]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P2: Fix to check if sae_password is present
authorShivani Baranwal <quic_shivbara@quicinc.com>
Tue, 15 Oct 2024 06:13:14 +0000 (11:43 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 23 Oct 2024 20:52:41 +0000 (23:52 +0300)
Fix the check for whether sae_password is present. Instead of checking
the static array's address which is always going to be true, verify that
the string is not empty.

Fixes: cf30af7c2f23 ("P2P2: Start P2P Client appropriately for P2P2 group")
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
wpa_supplicant/p2p_supplicant.c

index ef233127756f8388b7d930892e21bc143a23634e..0ec4a2e29d3122af39ad6c4727df3afc098726c5 100644 (file)
@@ -1890,7 +1890,7 @@ static void wpas_start_gc(struct wpa_supplicant *wpa_s,
 
        os_memcpy(ssid->bssid, res->peer_interface_addr, ETH_ALEN);
 
-       if (res->akmp == WPA_KEY_MGMT_PASN && res->sae_password) {
+       if (res->akmp == WPA_KEY_MGMT_PASN && res->sae_password[0]) {
                ssid->auth_alg = WPA_AUTH_ALG_SAE;
                ssid->sae_password = os_strdup(res->sae_password);
                if (!ssid->sae_password)