From: Jouni Malinen Date: Tue, 25 Dec 2012 17:35:15 +0000 (+0200) Subject: P2P: Be more careful with wpa_config_update_psk() call X-Git-Tag: hostap_2_0~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6350a148c46a8e6bdd5d699362cbbc1d7baad7b0;p=thirdparty%2Fhostap.git P2P: Be more careful with wpa_config_update_psk() call 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 --- diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 303339b4b..0a09b0042 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -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;