diff --git a/modules/es/fsw/src/cfe_es_api.c b/modules/es/fsw/src/cfe_es_api.c index fc3fe8972..b0b0463e1 100644 --- a/modules/es/fsw/src/cfe_es_api.c +++ b/modules/es/fsw/src/cfe_es_api.c @@ -780,7 +780,7 @@ CFE_Status_t CFE_ES_GetLibIDByName(CFE_ES_LibId_t *LibIdPtr, const char *LibName *-----------------------------------------------------------------*/ CFE_Status_t CFE_ES_GetTaskIDByName(CFE_ES_TaskId_t *TaskIdPtr, const char *TaskName) { - osal_id_t OsalId; + osal_id_t OsalId = OS_OBJECT_ID_UNDEFINED; int32 OsStatus; CFE_Status_t Result; @@ -2189,7 +2189,7 @@ int32 CFE_ES_LibID_ToIndex(CFE_ES_LibId_t LibId, uint32 *Idx) CFE_Status_t CFE_ES_TaskID_ToIndex(CFE_ES_TaskId_t TaskID, uint32 *Idx) { osal_id_t OsalID; - osal_index_t OsalIndex; + osal_index_t OsalIndex = OSAL_INDEX_C(0); int32 OsStatus; if (!CFE_RESOURCEID_TEST_DEFINED(TaskID)) diff --git a/modules/es/fsw/src/cfe_es_apps.c b/modules/es/fsw/src/cfe_es_apps.c index 4eb181d2f..1f7bb29ad 100644 --- a/modules/es/fsw/src/cfe_es_apps.c +++ b/modules/es/fsw/src/cfe_es_apps.c @@ -81,7 +81,7 @@ void CFE_ES_StartApplications(uint32 ResetType, const char *StartFilePath) osal_id_t AppFile = OS_OBJECT_ID_UNDEFINED; int32 Status; int32 OsStatus; - char c; + char c = 0; bool LineTooLong = false; bool FileOpened = false; @@ -401,7 +401,7 @@ int32 CFE_ES_ParseFileEntry(const char **TokenList, uint32 NumTokens) int32 CFE_ES_LoadModule(CFE_ResourceId_t ParentResourceId, const char *ModuleName, const CFE_ES_ModuleLoadParams_t *LoadParams, CFE_ES_ModuleLoadStatus_t *LoadStatus) { - osal_id_t ModuleId; + osal_id_t ModuleId = OS_OBJECT_ID_UNDEFINED; cpuaddr InitSymbolAddress; int32 ReturnCode; int32 OsStatus; @@ -590,7 +590,7 @@ int32 CFE_ES_StartAppTask(CFE_ES_TaskId_t *TaskIdPtr, const char *TaskName, CFE_ const CFE_ES_TaskStartParams_t *Params, CFE_ES_AppId_t ParentAppId) { CFE_ES_TaskRecord_t *TaskRecPtr; - osal_id_t OsalTaskId; + osal_id_t OsalTaskId = OS_OBJECT_ID_UNDEFINED; CFE_ES_TaskId_t LocalTaskId; int32 OsStatus; int32 ReturnCode; @@ -1785,6 +1785,8 @@ void CFE_ES_CopyModuleAddressInfo(osal_id_t ModuleId, CFE_ES_AppInfo_t *AppInfoP OS_module_prop_t ModuleInfo; int32 OsStatus; + memset(&ModuleInfo, 0, sizeof(ModuleInfo)); + OsStatus = OS_ModuleInfo(ModuleId, &ModuleInfo); if (OsStatus == OS_SUCCESS) { @@ -1794,7 +1796,6 @@ void CFE_ES_CopyModuleAddressInfo(osal_id_t ModuleId, CFE_ES_AppInfo_t *AppInfoP else { AppInfoPtr->AddressesAreValid = false; - memset(&ModuleInfo, 0, sizeof(ModuleInfo)); } /* diff --git a/modules/es/fsw/src/cfe_es_backgroundtask.c b/modules/es/fsw/src/cfe_es_backgroundtask.c index f3e7cab11..9750f0d7b 100644 --- a/modules/es/fsw/src/cfe_es_backgroundtask.c +++ b/modules/es/fsw/src/cfe_es_backgroundtask.c @@ -106,6 +106,9 @@ void CFE_ES_BackgroundTask(void) OS_time_t LastTime; const CFE_ES_BackgroundJobEntry_t *JobPtr; + memset(&LastTime, 0, sizeof(LastTime)); + memset(&CurrTime, 0, sizeof(CurrTime)); + CFE_PSP_GetTime(&LastTime); while (true) diff --git a/modules/es/fsw/src/cfe_es_start.c b/modules/es/fsw/src/cfe_es_start.c index e5ee5cfdb..f90a24893 100644 --- a/modules/es/fsw/src/cfe_es_start.c +++ b/modules/es/fsw/src/cfe_es_start.c @@ -475,11 +475,13 @@ void CFE_ES_InitializeFileSystems(uint32 StartType) { int32 OsStatus; int32 PspStatus; - cpuaddr RamDiskMemoryAddress; + cpuaddr RamDiskMemoryAddress = 0; uint32 RamDiskMemorySize; int32 PercentFree; OS_statvfs_t StatBuf; + memset(&StatBuf, 0, sizeof(StatBuf)); + /* ** Get the memory area for the RAM disk */ diff --git a/modules/es/fsw/src/cfe_es_syslog.c b/modules/es/fsw/src/cfe_es_syslog.c index 4a5865722..7f1f77f45 100644 --- a/modules/es/fsw/src/cfe_es_syslog.c +++ b/modules/es/fsw/src/cfe_es_syslog.c @@ -450,7 +450,7 @@ void CFE_ES_SysLog_vsnprintf(char *Buffer, size_t BufferSize, const char *SpecSt *-----------------------------------------------------------------*/ int32 CFE_ES_SysLogDump(const char *Filename) { - osal_id_t fd; + osal_id_t fd = OS_OBJECT_ID_UNDEFINED; int32 OsStatus; int32 Status; size_t WritePos; diff --git a/modules/evs/fsw/src/cfe_evs_utils.c b/modules/evs/fsw/src/cfe_evs_utils.c index ba5d5b075..fb8e9de43 100644 --- a/modules/evs/fsw/src/cfe_evs_utils.c +++ b/modules/evs/fsw/src/cfe_evs_utils.c @@ -358,6 +358,9 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1 CFE_EVS_ShortEventTlm_t ShortEventTlm; /* The "short" flavor is only generated if selected */ int ExpandedLength; + memset(&LongEventTlm, 0, sizeof(LongEventTlm)); + memset(&ShortEventTlm, 0, sizeof(ShortEventTlm)); + /* Initialize EVS event packets */ CFE_MSG_Init(CFE_MSG_PTR(LongEventTlm.TelemetryHeader), CFE_SB_ValueToMsgId(CFE_EVS_LONG_EVENT_MSG_MID), sizeof(LongEventTlm)); diff --git a/modules/sb/fsw/src/cfe_sb_task.c b/modules/sb/fsw/src/cfe_sb_task.c index 13498d6a8..d62f3ad51 100644 --- a/modules/sb/fsw/src/cfe_sb_task.c +++ b/modules/sb/fsw/src/cfe_sb_task.c @@ -857,9 +857,9 @@ void CFE_SB_CollectRouteInfo(CFE_SBR_RouteId_t RouteId, void *ArgPtr) int32 CFE_SB_SendSubscriptionReport(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId, CFE_SB_Qos_t Quality) { CFE_SB_SingleSubscriptionTlm_t SubRptMsg; - int32 Status; + int32 Status = CFE_SUCCESS; - Status = CFE_SUCCESS; + memset(&SubRptMsg, 0, sizeof(SubRptMsg)); if (CFE_SB_Global.SubscriptionReporting == CFE_SB_ENABLE) {