@@ -628,7 +628,8 @@ DSP_STATUS COD_OpenBase(struct COD_MANAGER *hMgr, IN char *pszCoffPath,
} else {
/* hang onto the library for subsequent sym table usage */
hMgr->baseLib = lib;
- strncpy(hMgr->szZLFile, pszCoffPath, COD_MAXPATHLENGTH);
+ strncpy(hMgr->szZLFile, pszCoffPath, COD_MAXPATHLENGTH - 1);
+ hMgr->szZLFile[COD_MAXPATHLENGTH - 1] = '\0';
}
return status;
@@ -1508,8 +1508,9 @@ DSP_STATUS DRV_RequestResources(u32 dwContext, u32 *pDevNodeString)
pszdevNode = MEM_Calloc(sizeof(struct DRV_EXT), MEM_NONPAGED);
if (pszdevNode) {
LST_InitElem(&pszdevNode->link);
- strncpy((char *) pszdevNode->szString,
- (char *)dwContext, MAXREGPATHLENGTH);
+ strncpy(pszdevNode->szString,
+ (char *)dwContext, MAXREGPATHLENGTH - 1);
+ pszdevNode->szString[MAXREGPATHLENGTH - 1] = '\0';
/* Update the Driver Object List */
*pDevNodeString = (u32)pszdevNode->szString;
LST_PutTail(pDRVObject->devNodeString,
@@ -238,8 +238,10 @@ DSP_STATUS regsupSetValue(char *valName, void *pBuf, u32 dataSize)
/* No match, need to make a new entry */
/* First check to see if we can make any more entries. */
if (pRegKey->numValueEntries < BRIDGE_MAX_NUM_REG_ENTRIES) {
- strncpy(pRegKey->values[pRegKey->numValueEntries].name,
- valName, BRIDGE_MAX_NAME_SIZE);
+ char *tmp_name =
+ pRegKey->values[pRegKey->numValueEntries].name;
+ strncpy(tmp_name, valName, BRIDGE_MAX_NAME_SIZE - 1);
+ tmp_name[BRIDGE_MAX_NAME_SIZE - 1] = '\0';
pRegKey->values[pRegKey->numValueEntries].pData =
MEM_Alloc(dataSize, MEM_NONPAGED);
if (pRegKey->values[pRegKey->numValueEntries].pData !=
Signed-off-by: Ameya Palande <ameya.palande@nokia.com> --- drivers/dsp/bridge/pmgr/cod.c | 3 ++- drivers/dsp/bridge/rmgr/drv.c | 5 +++-- drivers/dsp/bridge/services/regsup.c | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-)