From d4dd7bdc5429396ddb1d77a32630349aed2af754 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Thu, 14 Mar 2019 11:17:11 +0100 Subject: [PATCH] Add check for psta->cmn.aid out of bounds. --- core/rtw_sta_mgt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index 0d3794a..d6aaef1 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -757,6 +757,11 @@ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta) #ifdef CONFIG_NATIVEAP_MLME + if (psta->cmn.aid > 31) { + pr_err("***** psta->aid (%d) out of bounds\n", psta->cmn.aid); + return _FAIL; + } + if (pmlmeinfo->state == _HW_STATE_AP_) { pstapriv->sta_dz_bitmap &= ~BIT(psta->cmn.aid); pstapriv->tim_bitmap &= ~BIT(psta->cmn.aid);