Fix #2488, separate bad argument test#2489
Merged
Conversation
eae96f5 to
f83135a
Compare
Pass in CFE_SB_INVALID_MSG_ID separately from a NULL pointer. This also required updates to the way the MSG module checks the MsgID, as it was not using the IsValidMsgID check.
f83135a to
a9989fb
Compare
Contributor
Author
|
@skliper --- do you know why the original "SetMsgId()" only checked against HIGHEST_VALID_MSGID instead of using the check implemented in SB? Was there a justification for having a different/lesser validation of MsgId in this particular code? I'm curious because I don't see any real reason it should be more permissive, yet there seemed to be coverage tests checking for the fact that a msgID value of "0" can be successfully set. |
Contributor
|
I think that's just left over from when |
skliper
approved these changes
Dec 20, 2023
2 tasks
dzbaker
added a commit
to nasa/cFS
that referenced
this pull request
Jan 17, 2024
*Combines:* sample_app equuleus-rc1+dev36 sch_lab equuleus-rc1+dev29 to_lab equuleus-rc1+dev38 sample_lib equuleus-rc1+dev2 tblCRCTool equuleus-rc1+dev2 cFS-GroundSystem equuleus-rc1+dev2 elf2cfetbl equuleus-rc1+dev10 cFE equuleus-rc1+dev75 PSP equuleus-rc1+dev38 osal equuleus-rc1+dev33 **Includes:** *sample_app* - nasa/sample_app#226 *sch_lab* - nasa/sch_lab#161 *to_lab* - nasa/sch_lab#186 *sample_lib* - nasa/sample_lib#96 *tblCRCTool* - nasa/tblCRCTool#80 *cFS-GroundSystem* - nasa/cFS-GroundSystem#239 *elf2cfetbl* - nasa/elf2cfetbl#144 - nasa/elf2cfetbl#143 *cFE* - nasa/cFE#2463 - nasa/cFE#2486 - nasa/cFE#2485 - nasa/cFE#2489 *PSP* - nasa/PSP#422 - nasa/PSP#427 *osal* - nasa/osal#1437 - nasa/osal#1442 Co-authored by: Joseph Hickey <[email protected]> Co-authored by: Dylan Baker <[email protected]>
dzbaker
added a commit
to nasa/cFS
that referenced
this pull request
Jan 18, 2024
*Combines:* sample_app equuleus-rc1+dev36 sch_lab equuleus-rc1+dev29 to_lab equuleus-rc1+dev38 sample_lib equuleus-rc1+dev2 tblCRCTool equuleus-rc1+dev2 cFS-GroundSystem equuleus-rc1+dev2 elf2cfetbl equuleus-rc1+dev10 cFE equuleus-rc1+dev75 PSP equuleus-rc1+dev38 osal equuleus-rc1+dev33 **Includes:** *sample_app* - nasa/sample_app#226 *sch_lab* - nasa/sch_lab#161 *to_lab* - nasa/sch_lab#186 *sample_lib* - nasa/sample_lib#96 *tblCRCTool* - nasa/tblCRCTool#80 *cFS-GroundSystem* - nasa/cFS-GroundSystem#239 *elf2cfetbl* - nasa/elf2cfetbl#144 - nasa/elf2cfetbl#143 *cFE* - nasa/cFE#2463 - nasa/cFE#2486 - nasa/cFE#2485 - nasa/cFE#2489 *PSP* - nasa/PSP#422 - nasa/PSP#427 *osal* - nasa/osal#1437 - nasa/osal#1442 Co-authored by: Joseph Hickey <[email protected]> Co-authored by: Dylan Baker <[email protected]>
dzbaker
added a commit
to nasa/cFS
that referenced
this pull request
Jan 18, 2024
*Combines:* sample_app equuleus-rc1+dev36 sch_lab equuleus-rc1+dev29 to_lab equuleus-rc1+dev38 sample_lib equuleus-rc1+dev2 tblCRCTool equuleus-rc1+dev2 cFS-GroundSystem equuleus-rc1+dev2 elf2cfetbl equuleus-rc1+dev10 cFE equuleus-rc1+dev75 PSP equuleus-rc1+dev38 osal equuleus-rc1+dev33 **Includes:** *sample_app* - nasa/sample_app#226 *sch_lab* - nasa/sch_lab#161 *to_lab* - nasa/sch_lab#186 *sample_lib* - nasa/sample_lib#96 *tblCRCTool* - nasa/tblCRCTool#80 *cFS-GroundSystem* - nasa/cFS-GroundSystem#239 *elf2cfetbl* - nasa/elf2cfetbl#144 - nasa/elf2cfetbl#143 *cFE* - nasa/cFE#2463 - nasa/cFE#2486 - nasa/cFE#2485 - nasa/cFE#2489 *PSP* - nasa/PSP#422 - nasa/PSP#427 *osal* - nasa/osal#1437 - nasa/osal#1442 Co-authored by: Joseph Hickey <[email protected]> Co-authored by: Dylan Baker <[email protected]>
dzbaker
added a commit
to nasa/cFS
that referenced
this pull request
Jan 18, 2024
*Combines:* sample_app equuleus-rc1+dev36 sch_lab equuleus-rc1+dev29 to_lab equuleus-rc1+dev38 sample_lib equuleus-rc1+dev2 tblCRCTool equuleus-rc1+dev2 cFS-GroundSystem equuleus-rc1+dev2 elf2cfetbl equuleus-rc1+dev10 cFE equuleus-rc1+dev75 PSP equuleus-rc1+dev38 osal equuleus-rc1+dev33 **Includes:** *sample_app* - nasa/sample_app#226 *sch_lab* - nasa/sch_lab#161 *to_lab* - nasa/sch_lab#186 *sample_lib* - nasa/sample_lib#96 *tblCRCTool* - nasa/tblCRCTool#80 *cFS-GroundSystem* - nasa/cFS-GroundSystem#239 *elf2cfetbl* - nasa/elf2cfetbl#144 - nasa/elf2cfetbl#143 *cFE* - nasa/cFE#2463 - nasa/cFE#2486 - nasa/cFE#2485 - nasa/cFE#2489 *PSP* - nasa/PSP#422 - nasa/PSP#427 *osal* - nasa/osal#1437 - nasa/osal#1442 Co-authored by: Joseph Hickey <[email protected]> Co-authored by: Dylan Baker <[email protected]>
dzbaker
added a commit
to nasa/cFS
that referenced
this pull request
Jan 18, 2024
*Combines:* sample_app equuleus-rc1+dev36 sch_lab equuleus-rc1+dev29 to_lab equuleus-rc1+dev38 sample_lib equuleus-rc1+dev2 tblCRCTool equuleus-rc1+dev2 cFS-GroundSystem equuleus-rc1+dev2 elf2cfetbl equuleus-rc1+dev10 cFE equuleus-rc1+dev75 PSP equuleus-rc1+dev38 osal equuleus-rc1+dev33 **Includes:** *sample_app* - nasa/sample_app#226 *sch_lab* - nasa/sch_lab#161 *to_lab* - nasa/sch_lab#186 *sample_lib* - nasa/sample_lib#96 *tblCRCTool* - nasa/tblCRCTool#80 *cFS-GroundSystem* - nasa/cFS-GroundSystem#239 *elf2cfetbl* - nasa/elf2cfetbl#144 - nasa/elf2cfetbl#143 *cFE* - nasa/cFE#2463 - nasa/cFE#2486 - nasa/cFE#2485 - nasa/cFE#2489 *PSP* - nasa/PSP#422 - nasa/PSP#427 *osal* - nasa/osal#1437 - nasa/osal#1442 Co-authored by: Joseph Hickey <[email protected]> Co-authored by: Dylan Baker <[email protected]>
dzbaker
added a commit
to nasa/cFS
that referenced
this pull request
Jan 18, 2024
*Combines:* sample_app equuleus-rc1+dev36 sch_lab equuleus-rc1+dev29 to_lab equuleus-rc1+dev38 sample_lib equuleus-rc1+dev2 tblCRCTool equuleus-rc1+dev2 cFS-GroundSystem equuleus-rc1+dev2 elf2cfetbl equuleus-rc1+dev10 cFE equuleus-rc1+dev75 PSP equuleus-rc1+dev38 osal equuleus-rc1+dev33 **Includes:** *sample_app* - nasa/sample_app#226 *sch_lab* - nasa/sch_lab#161 *to_lab* - nasa/sch_lab#186 *sample_lib* - nasa/sample_lib#96 *tblCRCTool* - nasa/tblCRCTool#80 *cFS-GroundSystem* - nasa/cFS-GroundSystem#239 *elf2cfetbl* - nasa/elf2cfetbl#144 - nasa/elf2cfetbl#143 *cFE* - nasa/cFE#2463 - nasa/cFE#2486 - nasa/cFE#2485 - nasa/cFE#2489 *PSP* - nasa/PSP#422 - nasa/PSP#427 *osal* - nasa/osal#1437 - nasa/osal#1442 Co-authored by: Joseph Hickey <[email protected]> Co-authored by: Dylan Baker <[email protected]>
dzbaker
added a commit
to nasa/cFS
that referenced
this pull request
Jan 18, 2024
*Combines:* sample_app equuleus-rc1+dev36 sch_lab equuleus-rc1+dev29 to_lab equuleus-rc1+dev38 sample_lib equuleus-rc1+dev2 tblCRCTool equuleus-rc1+dev2 cFS-GroundSystem equuleus-rc1+dev2 elf2cfetbl equuleus-rc1+dev10 cFE equuleus-rc1+dev75 PSP equuleus-rc1+dev38 osal equuleus-rc1+dev33 **Includes:** *sample_app* - nasa/sample_app#226 *sch_lab* - nasa/sch_lab#161 *to_lab* - nasa/sch_lab#186 *sample_lib* - nasa/sample_lib#96 *tblCRCTool* - nasa/tblCRCTool#80 *cFS-GroundSystem* - nasa/cFS-GroundSystem#239 *elf2cfetbl* - nasa/elf2cfetbl#144 - nasa/elf2cfetbl#143 *cFE* - nasa/cFE#2463 - nasa/cFE#2486 - nasa/cFE#2485 - nasa/cFE#2489 *PSP* - nasa/PSP#422 - nasa/PSP#427 *osal* - nasa/osal#1437 - nasa/osal#1442 Co-authored by: Joseph Hickey <[email protected]> Co-authored by: Dylan Baker <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist (Please check before submitting)
Describe the contribution
Pass in CFE_SB_INVALID_MSG_ID separately from a NULL pointer. This also required updates to the way the MSG module checks the MsgID, as it was not using the IsValidMsgID check.
Fixes #2488
Testing performed
Build and run all tests
Expected behavior changes
CFE_MSG_Init() will now return the BAD_ARGUMENT code if passed CFE_SB_INVALID_MSG_ID. Oddly, this was not the case previously, it would still return CFE_SUCCESS. This is because the MSG implementation wasn't using the same check function (CFE_SB_IsValidMsgID). This PR corrects that.
System(s) tested on
Debian
Additional context
This is correct behavior now, but its one of those things where I can't be totally sure if some app was relying on the incorrect behavior.
Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.