From: Jouni Malinen Date: Thu, 5 Sep 2024 21:47:29 +0000 (+0300) Subject: AP MLD: Fix link_id validity check for own links X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba6b3dc78e134e3ffe862535bd985c75e13411fa;p=thirdparty%2Fhostap.git AP MLD: Fix link_id validity check for own links The check against MAX_NUM_MLD_LINKS was off by one for the loop that goes through hapd->partner_links[]. It does not look like this would actually result in any real issues since the loop is on own set of configured links. Anyway, it is better to have the bounds checking accurate. Fixes: 2042cae9b3a4 ("AP MLD: Generate and keep per STA profiles for each link") Signed-off-by: Jouni Malinen --- diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 7359dfd3e..2e3d90466 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -3125,7 +3125,7 @@ static void hostapd_gen_per_sta_profiles(struct hostapd_data *hapd) continue; link_id = link_bss->mld_link_id; - if (link_id > MAX_NUM_MLD_LINKS) + if (link_id >= MAX_NUM_MLD_LINKS) continue; sta_profile = NULL;