diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c index cd2c164c3..043ec3580 100644 --- a/wpa_supplicant/bss.c +++ b/wpa_supplicant/bss.c @@ -986,6 +986,10 @@ void wpa_bss_flush_by_age(struct wpa_supplicant *wpa_s, int age) return; os_get_reltime(&t); + + if (t.sec < age) + return; /* avoid underflow; there can be no older entries */ + t.sec -= age; dl_list_for_each_safe(bss, n, &wpa_s->bss, struct wpa_bss, list) {