-
Notifications
You must be signed in to change notification settings - Fork 208
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 will crash if if called before message sent on pipe #494
Comments
This should be fixed. A user application error (last sender API called early) should not cause the cFE to crash. Recommend returning error and setting last sender to a known invalid id. uint32 0xFFFFFFFF is a possible choice. |
Please note that with respect to the "invalid message id" notion, there are a at least two other other related changes waiting in the wings that should be coordinated with this:
Lastly, note that there is an existing definition for an invalid CFE_SB_MsgId_t value, and it is currently:
In particular I'm bringing all this up because one must resist the temptation to do something like: And secondly don't assume CFE_SB_MsgId_t will always remain a simple integer. Assignments are OK (i.e. |
…s been sent on pipe
…s been sent on pipe
Fix #494, Updates CFE_SB_GetLastSenderID to check if message has been sent on pipe
CFE_SB_GetLastSenderID assumes that CFE_SB.PipeTbl[PipeId].CurrentBuff is not NULL. Upon CFE_SB_CreatePipe, this will be null. CurrentBuff is only set upon receiving a message in CFE_SB_RcvMsg(). So, if CFE_SB_GetLastSenderID is called before receiving a message the program will crash.
This is Steven Seeger from GSFC. Guess I have a personal account on github. :)
The text was updated successfully, but these errors were encountered: