-
Notifications
You must be signed in to change notification settings - Fork 236
Description
Describe the bug
CFE_SB_GetLastSenderID returns pointer to data that could be overwritten at any time
See #605 (comment) for related comments
To Reproduce
Conceptually - app calls CFE_SB_GetLastSenderID, gets pointer, data gets overwritten, app takes action based on overwritten data vs original context
Expected behavior
No race.
Code snips
cFE/fsw/cfe-core/src/sb/cfe_sb_api.c
Lines 1651 to 1657 in 60a5f65
| /* Get ptr to buffer descriptor for the last msg received on the given pipe */ | |
| Ptr2BufDescriptor = CFE_SB.PipeTbl[PipeId].CurrentBuff; | |
| /* Set the receivers pointer to the adr of 'Sender' struct in buf descriptor */ | |
| *Ptr = (CFE_SB_SenderId_t *) &Ptr2BufDescriptor -> Sender; | |
| CFE_SB_UnlockSharedData(__func__,__LINE__); |
System observed on:
N/A
Additional context
#605
Reporter Info
Jacob Hageman
Reactions are currently unavailable