]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Fix link_id validity check for own links
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 5 Sep 2024 21:47:29 +0000 (00:47 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 5 Sep 2024 22:06:32 +0000 (01:06 +0300)
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 <quic_jouni@quicinc.com>
src/ap/beacon.c

index 7359dfd3e8290bdf6147bcde53fed6ae9f89d47d..2e3d9046698a4f8d8990e4743302fda3dd64e742 100644 (file)
@@ -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;