From: Meng Yuan Date: Wed, 8 Jan 2025 08:10:10 +0000 (+0800) Subject: P2P: Check IEs buffer before use more consistently X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a971fa5b5bd73836d5f75ce418123df4d1d8f129;p=thirdparty%2Fhostap.git P2P: Check IEs buffer before use more consistently 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 --- diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 550531e5c..72910394c 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -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