qcacld-2.0: Fix Unitialized heap and stack usage

1.Fix unitialized heap use in csrGetStatistics by initializing
pointer of struct type WLANTL_TRANSFER_STA_TYPE to zero.
2.Fix unitialized stack use in csrRoamReadTSF by initializing
variable of struct type tCsrNeighborRoamBSSInfo to zero.

Change-Id: I4211b41b5e30d414e45691a5bab4048587cc8499
CRs-Fixed: 1018486
This commit is contained in:
Masti, Narayanraddi 2016-05-19 18:00:34 +05:30 committed by syphyr
parent 1f50bc7393
commit 46ee0e3e8a
1 changed files with 6 additions and 1 deletions

View File

@ -16738,6 +16738,8 @@ eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requeste
pTlStats = (WLANTL_TRANSFER_STA_TYPE *)vos_mem_malloc(sizeof(WLANTL_TRANSFER_STA_TYPE));
if (NULL != pTlStats)
{
vos_mem_set(pTlStats, sizeof(*pTlStats), 0);
//req TL for class D stats
if(WLANTL_GetStatistics(pMac->roam.gVosContext, pTlStats, staId))
{
@ -16799,6 +16801,8 @@ eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requeste
pTlStats = (WLANTL_TRANSFER_STA_TYPE *)vos_mem_malloc(sizeof(WLANTL_TRANSFER_STA_TYPE));
if (NULL != pTlStats)
{
vos_mem_set(pTlStats, sizeof(*pTlStats), 0);
//req TL for class D stats
if(!VOS_IS_STATUS_SUCCESS(WLANTL_GetStatistics(pMac->roam.gVosContext, pTlStats, staId)))
{
@ -19001,10 +19005,11 @@ VOS_STATUS csrRoamReadTSF(tpAniSirGlobal pMac, tANI_U8 *pTimestamp,
tANI_U8 sessionId)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrNeighborRoamBSSInfo handoffNode;
tCsrNeighborRoamBSSInfo handoffNode = {{0}};
tANI_U32 timer_diff = 0;
tANI_U32 timeStamp[2];
tpSirBssDescription pBssDescription = NULL;
csrNeighborRoamGetHandoffAPInfo(pMac, &handoffNode, sessionId);
pBssDescription = handoffNode.pBssDescription;
// Get the time diff in milli seconds