mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
qcacld-3.0: Fix potential buffer overflow
In the function sap_clear_session_param, sapctx->sessionId can have value more than max value allowed for the array mac_ctx->sap.sapCtxList. Add sanity check for the variable sapctx->sessionId Change-Id: I846a8a1435de63d0a2e34f23bc407e0a8fa53eb2 CRs-Fixed: 2162255
This commit is contained in:
parent
17d37b34b3
commit
ab088faa4a
1 changed files with 3 additions and 0 deletions
|
|
@ -2079,6 +2079,9 @@ QDF_STATUS sap_clear_session_param(tHalHandle hal, struct sap_context *sapctx,
|
|||
{
|
||||
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
|
||||
|
||||
if (sapctx->sessionId >= SAP_MAX_NUM_SESSION)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
mac_ctx->sap.sapCtxList[sapctx->sessionId].sessionID =
|
||||
CSR_SESSION_ID_INVALID;
|
||||
mac_ctx->sap.sapCtxList[sapctx->sessionId].pSapContext = NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue