]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use size_t instead of unsigned_int for last_scan_res
authorJouni Malinen <j@w1.fi>
Sun, 22 Mar 2020 15:30:23 +0000 (17:30 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 22 Mar 2020 16:50:04 +0000 (18:50 +0200)
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>
wpa_supplicant/bss.c
wpa_supplicant/wpa_supplicant_i.h

index 943a34081640d6f88142e052aaa5cf083a755177..127f43e5e6b3b545a989c144dbec25fd80109a18 100644 (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);
 }
 
index e77ebb8f9e82b158755fc777ea726130139615cc..775bce89e6d1a1b1acf96dfee61a920833289cf4 100644 (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;