aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-03-02 15:21:59 +0200
committerArne Coucheron <arco68@gmail.com>2014-09-09 22:18:26 +0000
commite6350606274342c9d85beedfe775bc9ea5379352 (patch)
treea29617112bac234ea2eb138c4eec7bde157e3cae
parent3cc49706dd4c4909a1ace4bae222696655663143 (diff)
downloadandroid_external_wpa_supplicant_8-e6350606274342c9d85beedfe775bc9ea5379352.tar.gz
android_external_wpa_supplicant_8-e6350606274342c9d85beedfe775bc9ea5379352.tar.bz2
android_external_wpa_supplicant_8-e6350606274342c9d85beedfe775bc9ea5379352.zip
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. CRs-Fixed: 684325 Change-Id: Ifb12fb53f5ca193e0d1c23c3115e3507108cbf00 Git-commit: 67adcd266c4ef3f9356190ef2c0727303f9532cb Git-repo : git://w1.fi/srv/git/hostap.git Signed-off-by: Jouni Malinen <j@w1.fi>
-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 8875d63c..810bf296 100644
--- a/wpa_supplicant/wnm_sta.c
+++ b/wpa_supplicant/wnm_sta.c
@@ -486,12 +486,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++) {