From: Hu Wang Date: Thu, 2 Nov 2023 07:11:09 +0000 (-0700) Subject: OWE: Fix for entry->ssid possibly NULL dereference X-Git-Tag: hostap_2_11~876 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75d33c988f513034daad59ac6b6b5fa6a673bd75;p=thirdparty%2Fhostap.git OWE: Fix for entry->ssid possibly NULL dereference Pointer entry->ssid might be passed to owe_trans_ssid_match() function as argument 3 with NULL value, and it may be dereferenced there. This looks like a theoretical case that would not be reached in practice, but anyway, it is better to check entry->ssid != NULL more consistently. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index f1dc00651..19f124174 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -5268,8 +5268,9 @@ struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s) #ifdef CONFIG_OWE if (!wpas_network_disabled(wpa_s, entry) && - owe_trans_ssid_match(wpa_s, bssid, entry->ssid, - entry->ssid_len) && + (entry->ssid && + owe_trans_ssid_match(wpa_s, bssid, entry->ssid, + entry->ssid_len)) && (!entry->bssid_set || os_memcmp(bssid, entry->bssid, ETH_ALEN) == 0)) return entry;