aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/p2p_supplicant.c
diff options
context:
space:
mode:
authorAyala Beker <ayala.beker@intel.com>2015-12-10 10:56:02 (GMT)
committerJouni Malinen <j@w1.fi>2015-12-17 22:24:51 (GMT)
commit1b3dd69d93a082a33fb442997e2fa5ab492010ac (patch)
treec4ad198c700cc37495fe5cefdd00d49bf315bcb0 /wpa_supplicant/p2p_supplicant.c
parent05736da8c6b237eb8e2de178381d56ea9fe76c21 (diff)
downloadhostap-1b3dd69d93a082a33fb442997e2fa5ab492010ac.zip
hostap-1b3dd69d93a082a33fb442997e2fa5ab492010ac.tar.gz
hostap-1b3dd69d93a082a33fb442997e2fa5ab492010ac.tar.bz2
P2P: Fix possible NULL pointer dereference
Fix wpas_p2p_invite() to call p2p_set_own_pref_freq_list() after the NULL check, to avoid NULL pointer dereference if P2P initialization were to have failed or P2P module getting deinitialized. Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Diffstat (limited to 'wpa_supplicant/p2p_supplicant.c')
-rw-r--r--wpa_supplicant/p2p_supplicant.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index c7ddc99..45dae50 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -6770,11 +6770,12 @@ int wpas_p2p_invite(struct wpa_supplicant *wpa_s, const u8 *peer_addr,
pref_freq_list, &size);
if (res)
return res;
- p2p_set_own_pref_freq_list(wpa_s->global->p2p, pref_freq_list, size);
if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
return -1;
+ p2p_set_own_pref_freq_list(wpa_s->global->p2p, pref_freq_list, size);
+
if (wpa_s->parent->conf->p2p_ignore_shared_freq &&
no_pref_freq_given && pref_freq > 0 &&
wpa_s->num_multichan_concurrent > 1 &&