From 84b42867275d9ce89a9a5b0b1609e662e669d52b Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 18 Aug 2022 11:20:28 -0500 Subject: [PATCH] Fix #2137, Squash uninit var static analysis warnings --- modules/cfe_testcase/src/sb_sendrecv_test.c | 2 +- modules/evs/fsw/src/cfe_evs_utils.c | 2 +- modules/evs/ut-coverage/evs_UT.c | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/cfe_testcase/src/sb_sendrecv_test.c b/modules/cfe_testcase/src/sb_sendrecv_test.c index f89db7a2c..79abe472e 100644 --- a/modules/cfe_testcase/src/sb_sendrecv_test.c +++ b/modules/cfe_testcase/src/sb_sendrecv_test.c @@ -226,7 +226,7 @@ void TestMsgBroadcast(void) CFE_SB_PipeId_t PipeId3 = CFE_SB_INVALID_PIPE; CFE_SB_PipeId_t PipeId4 = CFE_SB_INVALID_PIPE; CFE_FT_TestCmdMessage_t CmdMsg; - CFE_SB_MsgId_t MsgId; + CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID; CFE_SB_Buffer_t * MsgBuf1; CFE_SB_Buffer_t * MsgBuf2; CFE_SB_Buffer_t * MsgBuf3; diff --git a/modules/evs/fsw/src/cfe_evs_utils.c b/modules/evs/fsw/src/cfe_evs_utils.c index 669aefda8..3eb2af47a 100644 --- a/modules/evs/fsw/src/cfe_evs_utils.c +++ b/modules/evs/fsw/src/cfe_evs_utils.c @@ -301,7 +301,7 @@ bool EVS_CheckAndIncrementSquelchTokens(EVS_AppData_t *AppDataPtr) { bool NotSquelched = true; bool SendSquelchEvent = false; - OS_time_t CurrentTime; + OS_time_t CurrentTime = {0}; int64 DeltaTimeMs; int64 CreditCount; char AppName[OS_MAX_API_NAME]; diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index 0e6499449..5ead8f850 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -267,6 +267,9 @@ void Test_Init(void) UtPrintf("Begin Test Init"); + memset(&bitmaskcmd, 0, sizeof(bitmaskcmd)); + memset(&appbitcmd, 0, sizeof(appbitcmd)); + strncpy(appbitcmd.Payload.AppName, "ut_cfe_evs", sizeof(appbitcmd.Payload.AppName) - 1); appbitcmd.Payload.AppName[sizeof(appbitcmd.Payload.AppName) - 1] = '\0';