Skip to content

Commit

Permalink
Fix #1757, Handle fail status from internal functions of CFE_MSG_GetT…
Browse files Browse the repository at this point in the history
…ypeFromMsgId
  • Loading branch information
zanzaben committed Aug 4, 2021
1 parent 45a6ed1 commit 0b45436
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/msg/fsw/src/cfe_msg_msgid_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
*-----------------------------------------------------------------*/
CFE_Status_t CFE_MSG_GetTypeFromMsgId(CFE_SB_MsgId_t MsgId, CFE_MSG_Type_t *Type)
{

CFE_MSG_Message_t msg;
int32 Status;

/* Memset to initialize avoids possible GCC bug 53119 */
memset(&msg, 0, sizeof(msg));
Expand All @@ -46,8 +46,11 @@ CFE_Status_t CFE_MSG_GetTypeFromMsgId(CFE_SB_MsgId_t MsgId, CFE_MSG_Type_t *Type
return CFE_MSG_BAD_ARGUMENT;
}

CFE_MSG_SetMsgId(&msg, MsgId);
CFE_MSG_GetType(&msg, Type);
Status = CFE_MSG_SetMsgId(&msg, MsgId);
if (Status == CFE_SUCCESS)
{
Status = CFE_MSG_GetType(&msg, Type);
}

return CFE_SUCCESS;
return Status;
}

0 comments on commit 0b45436

Please sign in to comment.