aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bss.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2014-04-25 20:19:47 (GMT)
committerJouni Malinen <j@w1.fi>2014-04-29 09:52:10 (GMT)
commitece88f7697af9918522799697d4ac991b235d2f8 (patch)
tree5ad57d208873d7a94e4e7a7dc47e970574be17af /wpa_supplicant/bss.c
parentd06e9ac5f551a59928cad50802f7638b790f9b59 (diff)
downloadhostap-ece88f7697af9918522799697d4ac991b235d2f8.zip
hostap-ece88f7697af9918522799697d4ac991b235d2f8.tar.gz
hostap-ece88f7697af9918522799697d4ac991b235d2f8.tar.bz2
Make last_scan_res update easier for static analyzers
The check based on last_scan_res_used is sufficient for making sure that last_scan_res is allocated. However, it is a bit too complex for static analyzers to notice, so add an explicit check to avoid bogus reports. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/bss.c')
-rw-r--r--wpa_supplicant/bss.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index 482fc64..f99a8a7 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -674,7 +674,8 @@ void wpa_bss_update_scan_res(struct wpa_supplicant *wpa_s,
wpa_s->last_scan_res_size = siz;
}
- wpa_s->last_scan_res[wpa_s->last_scan_res_used++] = bss;
+ if (wpa_s->last_scan_res)
+ wpa_s->last_scan_res[wpa_s->last_scan_res_used++] = bss;
}