Explicitly check for last_ssid->ssid to be set in wpa_bss_flush_by_age()
before using memcmp() to compare the SSID against the one in the BSS
entry. This is not really expected to do any real comparison here since
the case where last_ssid->ssid is NULL implies bss->ssid_len to be 0.
Anyway, avoid the unexpected memcmp(ptr, NULL, 0) call in such a case to
avoid issues with C libraries that might prevent such as unexpected
behavior.
Signed-off-by: Sunil Ravi <sunilravi@google.com>
if (wpa_s->reassoc_same_ess &&
wpa_s->wpa_state != WPA_COMPLETED &&
wpa_s->last_ssid &&
+ wpa_s->last_ssid->ssid &&
bss->ssid_len == wpa_s->last_ssid->ssid_len &&
os_memcmp(bss->ssid, wpa_s->last_ssid->ssid,
bss->ssid_len) == 0)