aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2020-03-22 15:30:23 (GMT)
committerJouni Malinen <j@w1.fi>2020-03-22 16:50:04 (GMT)
commit4391ddd6395f63226ec3b14bcf325356653a614f (patch)
treec9105cd2cfa9f6ccceeb604d81f092fb8ce80764
parent7fb365893a0ee2d7c4ddc9654dc905086fffb698 (diff)
downloadhostap-4391ddd6395f63226ec3b14bcf325356653a614f.zip
hostap-4391ddd6395f63226ec3b14bcf325356653a614f.tar.gz
hostap-4391ddd6395f63226ec3b14bcf325356653a614f.tar.bz2
Use size_t instead of unsigned_int for last_scan_res
This avoids a theoretical unsigned integer overflow case with 32-bit integers, but something that could potentially be hit with 16-bit int (though, even that part looks pretty theoretical in this particular case of number of BSSs in scan results). Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--wpa_supplicant/bss.c2
-rw-r--r--wpa_supplicant/wpa_supplicant_i.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index 943a340..127f43e 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -906,7 +906,7 @@ void wpa_bss_update_end(struct wpa_supplicant *wpa_s, struct scan_info *info,
}
}
- wpa_printf(MSG_DEBUG, "BSS: last_scan_res_used=%u/%u",
+ wpa_printf(MSG_DEBUG, "BSS: last_scan_res_used=%zu/%zu",
wpa_s->last_scan_res_used, wpa_s->last_scan_res_size);
}
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index e77ebb8..775bce8 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -607,8 +607,8 @@ struct wpa_supplicant {
* results.
*/
struct wpa_bss **last_scan_res;
- unsigned int last_scan_res_used;
- unsigned int last_scan_res_size;
+ size_t last_scan_res_used;
+ size_t last_scan_res_size;
struct os_reltime last_scan;
const struct wpa_driver_ops *driver;