Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CFE_SB_GetLastSenderID returns pointer to internal data, possible race #608

Closed
skliper opened this issue Apr 14, 2020 · 2 comments · Fixed by #784 or #816
Closed

CFE_SB_GetLastSenderID returns pointer to internal data, possible race #608

skliper opened this issue Apr 14, 2020 · 2 comments · Fixed by #784 or #816
Labels
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Apr 14, 2020

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

/* 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

@skliper skliper added the bug label Apr 14, 2020
@skliper
Copy link
Contributor Author

skliper commented Apr 14, 2020

Ping @CDKnightNASA @tngo67 and any other user's of this API (SBN related?)

@astrogeco
Copy link
Contributor

astrogeco commented Aug 19, 2020

Closed, See #816

@astrogeco astrogeco added this to the 7.0.0 milestone Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants