]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Be more careful with wpa_config_update_psk() call
authorJouni Malinen <j@w1.fi>
Tue, 25 Dec 2012 17:35:15 +0000 (19:35 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 25 Dec 2012 17:35:15 +0000 (19:35 +0200)
Commit bb4d4deb4bbb7b094faa16fa41f1f49b062cbf22 introduced a code path
that could potentially end up calling wpa_config_update_psk() with NULL
passphrase. While that may not happen in practice, it is better to make
sure it doesn't happen since that function will dereference the
passphrase pointer unconditionally.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/p2p_supplicant.c

index 303339b4b9b80b4a5865b7b6656741cde08a577a..0a09b004238c46a9fb8a570d6f7c6c19400f4c62 100644 (file)
@@ -900,7 +900,7 @@ static void wpas_start_wps_go(struct wpa_supplicant *wpa_s,
        ssid->psk_set = params->psk_set;
        if (ssid->psk_set)
                os_memcpy(ssid->psk, params->psk, sizeof(ssid->psk));
-       else
+       else if (ssid->passphrase)
                wpa_config_update_psk(ssid);
        ssid->ap_max_inactivity = wpa_s->parent->conf->p2p_go_max_inactivity;