From cb354d32b13fc0fbddbc27cf6f54ca54e40f0e8b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 18 Oct 2025 11:08:10 +0300 Subject: [PATCH] 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 --- src/ap/drv_callbacks.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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", -- 2.47.3