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>
This commit is contained in:
Jouni Malinen 2020-03-22 17:30:23 +02:00
parent 7fb365893a
commit 4391ddd639
2 changed files with 3 additions and 3 deletions

View file

@ -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);
}

View file

@ -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;