From 4391ddd6395f63226ec3b14bcf325356653a614f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 22 Mar 2020 17:30:23 +0200 Subject: [PATCH] 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 --- wpa_supplicant/bss.c | 2 +- wpa_supplicant/wpa_supplicant_i.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c index 943a34081..127f43e5e 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 e77ebb8f9..775bce89e 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;