P2P: Fix P2P_FLUSH clearing of p2p_go_avoid_freq
authorIlan Peer <ilan.peer@intel.com>
Mon, 27 Jul 2015 19:24:30 +0000 (22:24 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 4 Aug 2015 15:59:59 +0000 (18:59 +0300)
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@intel.com>
wpa_supplicant/ctrl_iface.c

index e802489..e19ef9e 100644 (file)
@@ -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 */