From: Jouni Malinen Date: Sat, 18 Oct 2025 08:08:10 +0000 (+0300) Subject: Check hostapd_mld_get_link_bss() return value for NULL X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb354d32b13fc0fbddbc27cf6f54ca54e40f0e8b;p=thirdparty%2Fhostap.git Check hostapd_mld_get_link_bss() return value for NULL Even though this should not really return NULL for a case where a STA link has already been checked to be valid, it is better to be consistently checking for the theoretical NULL value from hostapd_mld_get_link_bss() (if for no other reason, then at least to silence warnings from static analyzers). Signed-off-by: Jouni Malinen --- diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index e4d02423b..16a15076c 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -499,7 +499,7 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr, continue; bss = hostapd_mld_get_link_bss(hapd, link_id); - if (bss != hapd && + if (bss && bss != hapd && hostapd_check_acl(bss, addr, NULL) != HOSTAPD_ACL_ACCEPT) { wpa_printf(MSG_INFO, "STA " MACSTR @@ -508,7 +508,8 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr, reason = WLAN_REASON_UNSPECIFIED; goto fail; } - if (hostapd_check_acl(bss, info->peer_addr, NULL) != + if (bss && + hostapd_check_acl(bss, info->peer_addr, NULL) != HOSTAPD_ACL_ACCEPT) { wpa_printf(MSG_INFO, "link addr " MACSTR " not allowed to connect",