]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Fix deinit path to clean neighbor report count
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 7 Apr 2014 10:35:18 +0000 (13:35 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 7 Apr 2014 10:40:45 +0000 (13:40 +0300)
wnm_deallocate_memory() left wnm_num_neighbor_report set while freeing
the allocated buffer of neighbor reports. If this function was called
twice in a row without having went through new neighbor report parsing,
invalid pointers could have been freed resulted in segfault.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/wnm_sta.c

index 952db0ac046ce3fbae2cc9749bae777bfa675b4e..1ca4c71faf77d2b16789d541250d05799b18ab5e 100644 (file)
@@ -319,6 +319,7 @@ void wnm_deallocate_memory(struct wpa_supplicant *wpa_s)
                os_free(wpa_s->wnm_neighbor_report_elements[i].mul_bssid);
        }
 
+       wpa_s->wnm_num_neighbor_report = 0;
        os_free(wpa_s->wnm_neighbor_report_elements);
        wpa_s->wnm_neighbor_report_elements = NULL;
 }