[PATCH 13/17] P2P: Fix P2P_FLUSH clearing of p2p_go_avoid_freq

Ilan Peer ilan.peer at intel.com
Mon Jul 27 15:24:30 EDT 2015


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 <ilan.peer at intel.com>
---
 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 f3cedaa..8743790 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -6759,6 +6759,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 */
 
-- 
1.9.1



More information about the HostAP mailing list