]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Check IEs buffer before use more consistently
authorMeng Yuan <quic_menyua@quicinc.com>
Wed, 8 Jan 2025 08:10:10 +0000 (16:10 +0800)
committerJouni Malinen <j@w1.fi>
Tue, 11 Feb 2025 21:05:59 +0000 (23:05 +0200)
Commit cab963e9f887 ("AP: Split check_assoc_ies()") added check for
ies/ies_len before going through the P2P element. Add similar checks for
p2p_group_notif_assoc() to be consistent and avoid potential risk of
associated STA tracking for P2P groups dereferencing NULL pointers.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/ieee802_11.c

index 550531e5cef09a09b3b73b87f8d89966b41a6ed3..72910394cfb9dd331ed9b348c2898e3fdbcb6c68 100644 (file)
@@ -4365,7 +4365,8 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
                wpa_auth_sta_no_wpa(sta->wpa_sm);
 
 #ifdef CONFIG_P2P
-       p2p_group_notif_assoc(hapd->p2p_group, sta->addr, ies, ies_len);
+       if (ies && ies_len)
+               p2p_group_notif_assoc(hapd->p2p_group, sta->addr, ies, ies_len);
 #endif /* CONFIG_P2P */
 
 #ifdef CONFIG_HS20