aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wnm_sta.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-03-02 13:21:59 (GMT)
committerJouni Malinen <j@w1.fi>2014-03-02 15:15:12 (GMT)
commit67adcd266c4ef3f9356190ef2c0727303f9532cb (patch)
tree6943f8823c34dafd76c6dcce0209a88cfb5f17f9 /wpa_supplicant/wnm_sta.c
parent3ff8073db7846f643f57323c7c66d5ad68629110 (diff)
downloadhostap-67adcd266c4ef3f9356190ef2c0727303f9532cb.zip
hostap-67adcd266c4ef3f9356190ef2c0727303f9532cb.tar.gz
hostap-67adcd266c4ef3f9356190ef2c0727303f9532cb.tar.bz2
WNM: Check wpa_s->current_bss more consistently
The scan result comparison routine would not make much sense without current BSS level known, so return from the function without going through the iteration that could have dereferenced the pointer if wpa_s->current_bss == NULL. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/wnm_sta.c')
-rw-r--r--wpa_supplicant/wnm_sta.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c
index 0619f6d..7db6eb6 100644
--- a/wpa_supplicant/wnm_sta.c
+++ b/wpa_supplicant/wnm_sta.c
@@ -471,12 +471,11 @@ static int compare_scan_neighbor_results(struct wpa_supplicant *wpa_s,
u8 i, j;
- if (scan_res == NULL || num_neigh_rep == 0)
+ if (scan_res == NULL || num_neigh_rep == 0 || !wpa_s->current_bss)
return 0;
wpa_printf(MSG_DEBUG, "WNM: Current BSS " MACSTR " RSSI %d",
- MAC2STR(wpa_s->bssid),
- wpa_s->current_bss ? wpa_s->current_bss->level : 0);
+ MAC2STR(wpa_s->bssid), wpa_s->current_bss->level);
for (i = 0; i < num_neigh_rep; i++) {
for (j = 0; j < scan_res->num; j++) {