P2P: Make p2p_go_configured() more robust against unexpected calls
authorJouni Malinen <j@w1.fi>
Sun, 29 Nov 2015 23:25:24 +0000 (01:25 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 29 Nov 2015 23:25:24 +0000 (01:25 +0200)
commitdd895e99647a2caa99d86231901bdcd81a4813fa
treeb212f0a3c62b420b925b00656638d0d83ccd4b33
parentd6ba709aa38064b56b2f593a106bf85ed80847c4
P2P: Make p2p_go_configured() more robust against unexpected calls

A hwsim test sequence was able to hit a SIGSEGV in
p2p_go_save_group_common_freqs() called by p2p_go_configured() callback
in a case where a non-P2P AP mode operation is started in wpa_supplicant
(wpas_ap_wep test case). This callback should not have happened for
non-P2P case and the debug logs did not make it clear how this could
happen. In addition, it is unclear how this could be reproduced.

To avoid this type of issues, clear the wpa_s->ap_configured_cb pointer
as soon as the first call to the function happens. In addition, verify
that wpa_s->go_params is available before processing the GO configured
callback.

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