From 85e152b646d5d877730e807c945aa31770f44fe2 Mon Sep 17 00:00:00 2001 From: Ilan Peer Date: Mon, 27 Jul 2015 22:24:30 +0300 Subject: [PATCH] P2P: Fix P2P_FLUSH clearing of p2p_go_avoid_freq P2P_FLUSH command did not cleanly clear the p2p_go_avoid_freq data structure, and left it in an inconsistent state, where the range field was NULL but the num field was not 0. This would have resulted in an invalid memory access in freq_range_list_includes(). Fix this. Signed-off-by: Ilan Peer --- wpa_supplicant/ctrl_iface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index e802489ed..e19ef9e16 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -6793,6 +6793,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s) p2p_wpa_s->p2p_disable_ip_addr_req = 0; os_free(p2p_wpa_s->global->p2p_go_avoid_freq.range); p2p_wpa_s->global->p2p_go_avoid_freq.range = NULL; + p2p_wpa_s->global->p2p_go_avoid_freq.num = 0; p2p_wpa_s->global->pending_p2ps_group = 0; #endif /* CONFIG_P2P */