Skip to content

Commit

Permalink
Hotfix nasa#2526, add missing memset() for stack variables
Browse files Browse the repository at this point in the history
Correct two cases where struct variables on the stack were not
being properly cleared before use.
  • Loading branch information
jphickey committed Mar 11, 2024
1 parent c455527 commit c05e518
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/es/fsw/src/cfe_es_apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ int32 CFE_ES_ParseFileEntry(const char **TokenList, uint32 NumTokens)
int32 Status;
CFE_ES_AppStartParams_t ParamBuf;

memset(&ParamBuf, 0, sizeof(ParamBuf));

/*
** Check to see if the correct number of items were parsed
*/
Expand Down
2 changes: 2 additions & 0 deletions modules/es/fsw/src/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,8 @@ int32 CFE_ES_StartAppCmd(const CFE_ES_StartAppCmd_t *data)
char LocalAppName[OS_MAX_API_NAME];
CFE_ES_AppStartParams_t StartParams;

memset(&StartParams, 0, sizeof(StartParams));

/* Create local copies of all input strings and ensure null termination */
Result = CFE_FS_ParseInputFileNameEx(StartParams.BasicInfo.FileName, cmd->AppFileName,
sizeof(StartParams.BasicInfo.FileName), sizeof(cmd->AppFileName), NULL,
Expand Down

0 comments on commit c05e518

Please sign in to comment.