-
Notifications
You must be signed in to change notification settings - Fork 232
Description
Describe the bug
CFE_SB_SendMsg copies from local the contents of the passed in message pointer, but CFE_SB_TimeStampMsg copies from local the value of MsgPtr.
To Reproduce
Steps to reproduce the behavior:
-
cFE/fsw/cfe-core/ut-stubs/ut_sb_stubs.c
Lines 474 to 494 in 5ac3f0a
int32 CFE_SB_SendMsg(CFE_SB_Msg_t *MsgPtr) { UT_Stub_RegisterContext(UT_KEY(CFE_SB_SendMsg), MsgPtr); int32 status = CFE_SUCCESS; /* * Create a context entry so a hook function * could do something useful with the message */ status = UT_DEFAULT_IMPL(CFE_SB_SendMsg); if (status >= 0) { UT_Stub_CopyFromLocal(UT_KEY(CFE_SB_SendMsg), MsgPtr->Byte, CFE_SB_StubMsg_GetMetaData(MsgPtr)->TotalLength); } return status; } -
Compare with
cFE/fsw/cfe-core/ut-stubs/ut_sb_stubs.c
Lines 709 to 715 in 5ac3f0a
void CFE_SB_TimeStampMsg(CFE_SB_MsgPtr_t MsgPtr) { UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_TimeStampMsg), MsgPtr); UT_DEFAULT_IMPL(CFE_SB_TimeStampMsg); UT_Stub_CopyFromLocal(UT_KEY(CFE_SB_TimeStampMsg), &MsgPtr, sizeof(MsgPtr)); }
Expected behavior
Default CFE_SB_SendMsg stub behavior should be like CFE_SB_TimeStampMsg. A hook should be required to provide extra behavior.
Code snips
See above.
System observed on:
RHEL 7.6
Additional context
N/A
Reporter Info
Alan Gibson NASA GSFC/587