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>
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;