diff --git a/drivers/staging/prima/CORE/MAC/src/include/dot11f.h b/drivers/staging/prima/CORE/MAC/src/include/dot11f.h index 52c714e46ba..f97ea32a76d 100644 --- a/drivers/staging/prima/CORE/MAC/src/include/dot11f.h +++ b/drivers/staging/prima/CORE/MAC/src/include/dot11f.h @@ -30,7 +30,7 @@ * * * This file was automatically generated by 'framesc' - * Tue Jul 4 11:19:48 2017 from the following file(s): + * Thu Dec 28 14:04:50 2017 from the following file(s): * * dot11f.frms * diff --git a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/dot11f.c b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/dot11f.c index f3f621cf99a..2cd555c21d1 100644 --- a/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/dot11f.c +++ b/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/dot11f.c @@ -28,7 +28,7 @@ * * * This file was automatically generated by 'framesc' - * Tue Jul 4 11:19:48 2017 from the following file(s): + * Thu Dec 28 14:04:50 2017 from the following file(s): * * dot11f.frms * @@ -482,7 +482,7 @@ static tANI_U32 GetContainerIesLen(tpAniSirGlobal pCtx, len += 2; while ( len < nBuf ) { - if( NULL == (pIe = FindIEDefn(pCtx, pBufRemaining, nBuf + len, IEs))) + if( NULL == (pIe = FindIEDefn(pCtx, pBufRemaining, nBuf - len, IEs))) break; if( pIe->eid == pIeFirst->eid ) break; @@ -490,6 +490,8 @@ static tANI_U32 GetContainerIesLen(tpAniSirGlobal pCtx, pBufRemaining += *(pBufRemaining + 1) + 2; } + if ((len > 0xFF) || (len > nBuf)) + return DOT11F_INTERNAL_ERROR; *pnConsumed = len; return DOT11F_PARSE_SUCCESS; @@ -20710,11 +20712,13 @@ static tANI_U32 UnpackCore(tpAniSirGlobal pCtx, if (pIe) { - if (nBufRemaining < pIe->minSize - pIe->noui - 2U) + if ((nBufRemaining < pIe->minSize - pIe->noui - 2U) || + (len < pIe->minSize - pIe->noui - 2U)) { - FRAMES_LOG3(pCtx, FRLOGW, FRFL("The IE %s must be " - "at least %d bytes in size, but there are onl" - "y %d bytes remaining in this frame.\n"), + FRAMES_LOG3(pCtx, FRLOGW, FRFL("The IE %s must " + "be at least %d bytes in size, but " + "there are only %d bytes remaining in " + "this frame\n"), pIe->name, pIe->minSize, nBufRemaining); FRAMES_DUMP(pCtx, FRLOG1, pBuf, nBuf); status |= DOT11F_INCOMPLETE_IE;