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

Fix #89, separate msg size verify #94

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

jphickey
Copy link
Contributor

Checklist (Please check before submitting)

Describe the contribution
Move the CMD message input size validation to a separate function, so the command handler does not do this itself. This allows the handler to focus on the real message action as opposed to the structure of the message itself.

Fixes #89

Testing performed
Build and run all tests. Run FM in CFE and send commands to check behavior.

Expected behavior changes
No impact to behavior - improve source code structure/unit separation only

System(s) tested on
Debian

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

Move the CMD message input size validation to a separate function, so
the command handler does not do this itself.  This allows the handler to
focus on the real message action as opposed to the structure of the
message itself.
/* FM application -- command packet processor */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void FM_ProcessCmd(const CFE_SB_Buffer_t *BufPtr)

Check notice

Code scanning / CodeQL-coding-standard

Function too long

FM_ProcessCmd has too many lines (103, while 60 are allowed).
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

bool FM_IsValidCmdPktLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength, uint32 EventID, const char *CmdText)

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
/* FM application -- command packet processor */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void FM_ProcessCmd(const CFE_SB_Buffer_t *BufPtr)

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

void FM_ProcessPkt(const CFE_SB_Buffer_t *BufPtr)

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
@jphickey
Copy link
Contributor Author

This was reviewed in the 2023-03-23 CCB and approved.

The format check error was noted, however this is reporting on a file that did not change in this PR. This is probably a separate issue with the workflow - something is causing it to format these lines inconsistently.

@dzbaker dzbaker merged commit 87c2647 into nasa:main Mar 30, 2023
@jphickey jphickey deleted the fix-89-separate-verify branch March 31, 2023 13:54
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apps should check/verify msg BEFORE calling handler
4 participants