UBSan: Avoid memcmp(ptr, NULL, 0)
Skip the memcmp() call if ssid_len == 0 and entry->ssid might be NULL to avoid an UBSan warning. wpa_supplicant.c:3956:9: runtime error: null pointer passed as argument 2, which is declared to never be null Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
1b85cad29c
commit
c4fccfc7a5
1 changed files with 3 additions and 1 deletions
|
@ -3953,7 +3953,9 @@ struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s)
|
|||
while (entry) {
|
||||
if (!wpas_network_disabled(wpa_s, entry) &&
|
||||
((ssid_len == entry->ssid_len &&
|
||||
os_memcmp(ssid, entry->ssid, ssid_len) == 0) || wired) &&
|
||||
(!entry->ssid ||
|
||||
os_memcmp(ssid, entry->ssid, ssid_len) == 0)) ||
|
||||
wired) &&
|
||||
(!entry->bssid_set ||
|
||||
os_memcmp(bssid, entry->bssid, ETH_ALEN) == 0))
|
||||
return entry;
|
||||
|
|
Loading…
Reference in a new issue