]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Check a STA is VHT before copying VHT operation element
authorPablo Martin-Gomez <pmartin-gomez@freebox.fr>
Wed, 11 Jun 2025 18:38:07 +0000 (20:38 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 29 Sep 2025 11:04:59 +0000 (14:04 +0300)
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 <pmartin-gomez@freebox.fr>
src/ap/ieee802_11_vht.c

index 7415635bf39947a7a44565088000e330f5fa38f5..e7a7f8696a0850b940b143b716525a910fa5497b 100644 (file)
@@ -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;