From: Pablo Martin-Gomez Date: Wed, 11 Jun 2025 18:38:07 +0000 (+0200) Subject: AP: Check a STA is VHT before copying VHT operation element X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b58dacb3e3d6351badd04e8f0e17a22b2a18cecc;p=thirdparty%2Fhostap.git AP: Check a STA is VHT before copying VHT operation element If a VHT STA has an invalid VHT Capabilities element, the VHT capability of the STA is deactivated but the VHT operation element might still be copied without the VHT Capabilities element being present. Only copy the VHT operation element if a STA is VHT. Signed-off-by: Pablo Martin-Gomez --- diff --git a/src/ap/ieee802_11_vht.c b/src/ap/ieee802_11_vht.c index 7415635bf..e7a7f8696 100644 --- a/src/ap/ieee802_11_vht.c +++ b/src/ap/ieee802_11_vht.c @@ -216,7 +216,7 @@ u16 copy_sta_vht_capab(struct hostapd_data *hapd, struct sta_info *sta, u16 copy_sta_vht_oper(struct hostapd_data *hapd, struct sta_info *sta, const u8 *vht_oper) { - if (!vht_oper) { + if (!vht_oper || !(sta->flags & WLAN_STA_VHT)) { os_free(sta->vht_operation); sta->vht_operation = NULL; return WLAN_STATUS_SUCCESS;