Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions source/MRD/mrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#define MRD_ARP_BUFFER_LEN (MRD_ARP_STRING_LEN + 1)
/* Format for reading the 1st, and 4th space-delimited fields */
#define MRD_ARP_LINE_FORMAT "%1023s %*s %*s " \
"%1023s %*s %*s"
"%19s %*s %*s"
#define MRD_SHM_EXISTS 17
#define MRD_MAX_LOG 20000
#define MRD_LOG_FILE "/rdklogs/logs/mrdtrace.log"
Expand Down Expand Up @@ -126,7 +126,8 @@ static int mrd_getMACAddress(char *ipaddress, char *mac)
{
FILE *arpCache;
char header[MRD_ARP_BUFFER_LEN];
char ipAddr[MAC_ADDRESS_SIZE];
/*CID 746316: (#1 of 1): Out-of-bounds write (OVERRUN) coverity fix */
char ipAddr[MRD_ARP_BUFFER_LEN];
errno_t rc = -1;
int ind = -1;

Expand Down
14 changes: 11 additions & 3 deletions source/TR-181/board_sbapi/cosa_moca_apis.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,12 @@ CosaDmlMocaIfReset
{
return ANSC_STATUS_FAILURE;
}
/* Coverity CID 414230: STRING_NULL — validate all pointer params before any dereference */
if ( !MCfg )
{
CcspTraceWarning(("CosaDmlMocaIfReset -- MCfg is NULL\n"));
return ANSC_STATUS_FAILURE;
}

if (!pInfo)
{
Expand Down Expand Up @@ -605,7 +611,7 @@ CosaDmlMocaIfReset
}
mocaCfg.Alias[sizeof(mocaCfg.Alias) - 1] = '\0';
mocaCfg.KeyPassphrase[sizeof(mocaCfg.KeyPassphrase) - 1] = '\0';

mocaCfg.NodeTabooMask[sizeof(mocaCfg.NodeTabooMask) - 1] = 0;
/* MoCA Interface Setting to FALSE and syscfg commit it. That mean, we are disabled the MoCA interface here */
CcspTraceWarning(("%s > Disabling MoCA Interface...\n", __func__));
pCfg->bEnabled = FALSE;
Expand Down Expand Up @@ -1069,18 +1075,20 @@ CosaDmlMocaIfGetCfg
* Hence disabled it.
*/
// pCfg->InstanceNumber = mocaCfg.InstanceNumber;
rc = STRCPY_S_NOCLOBBER(pCfg->Alias, sizeof(pCfg->Alias), mocaCfg.Alias);
rc = STRCPY_S_NOCLOBBER(pCfg->Alias, sizeof(pCfg->Alias), mocaCfg.Alias);
if(rc != EOK)
{
ERR_CHK(rc);
return ANSC_STATUS_FAILURE;
}
pCfg->bEnabled = mocaCfg.bEnabled;
pCfg->bEnabled = mocaCfg.bEnabled;

if ( ( 1 != pCfg->bSnmpUpdate ) && ( moca_enable_db != pCfg->bEnabled ) )
{
AnscTraceWarning(("syscfg db and moca driver value are not in sync, setting db value to driver\n"));
mocaCfg.bEnabled=moca_enable_db;
/* CID 348463 coverity fix for string null error */
mocaCfg.NodeTabooMask[sizeof(mocaCfg.NodeTabooMask) - 1] = 0;
Comment on lines +1090 to +1091
if ( moca_SetIfConfig(uIndex, &mocaCfg) != STATUS_SUCCESS)
{
AnscTraceWarning(("moca_SetIfConfig returns error\n"));
Expand Down
4 changes: 3 additions & 1 deletion source/TR-181/board_sbapi/cosa_moca_webconfig_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,13 @@ int rollback_moca_conf()
/* Coverity CID 348464: STRING_NULL — ensure HAL string fields are terminated */
mocaCfg.Alias[sizeof(mocaCfg.Alias) - 1] = '\0';
mocaCfg.KeyPassphrase[sizeof(mocaCfg.KeyPassphrase) - 1] = '\0';

if( g_bMocaEnable_bkup != mocaCfg.bEnabled )
{
CcspTraceWarning(("%s: updating hal with backup value %d \n", __FUNCTION__, g_bMocaEnable_bkup ));
mocaCfg.bEnabled = g_bMocaEnable_bkup;
/* Coverity CID 348464: STRING_NULL — ensure HAL string fields are terminated */
mocaCfg.NodeTabooMask[sizeof(mocaCfg.NodeTabooMask) - 1] = 0;
Comment on lines +308 to +309
if ( moca_SetIfConfig(0, &mocaCfg) != STATUS_SUCCESS)
{
CcspTraceWarning(("%s: rollback_moca_conf hal call failed \n", __FUNCTION__));
Expand Down
Loading