mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
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
@ -3953,7 +3953,9 @@ struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s)
|
|||||||
while (entry) {
|
while (entry) {
|
||||||
if (!wpas_network_disabled(wpa_s, entry) &&
|
if (!wpas_network_disabled(wpa_s, entry) &&
|
||||||
((ssid_len == entry->ssid_len &&
|
((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 ||
|
(!entry->bssid_set ||
|
||||||
os_memcmp(bssid, entry->bssid, ETH_ALEN) == 0))
|
os_memcmp(bssid, entry->bssid, ETH_ALEN) == 0))
|
||||||
return entry;
|
return entry;
|
||||||
|
Loading…
Reference in New Issue
Block a user