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

Check message length vs bytes received before publishing #64

Closed
skliper opened this issue Nov 24, 2020 · 2 comments
Closed

Check message length vs bytes received before publishing #64

skliper opened this issue Nov 24, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@skliper
Copy link
Contributor

skliper commented Nov 24, 2020

Is your feature request related to a problem? Please describe.
Command ingest doesn't verify message length (from header) matches bytes received.

Describe the solution you'd like
Verify prior to publishing to SB (stop the error at the source).

Describe alternatives you've considered
Leave as is - command sources should be sending one valid message per datagram

Additional context
None.

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added the bug Something isn't working label Aug 9, 2021
@skliper
Copy link
Contributor Author

skliper commented Nov 15, 2023

@dzbaker @jphickey - looks like this was also fixed:

MsgBufPtr = SourceBuffer;
/* Check the size from within the header itself, compare against network buffer size */
CFE_MSG_GetSize(&MsgBufPtr->Msg, &MsgSize);
if (MsgSize > SourceSize)
{
Status = CFE_STATUS_WRONG_MSG_LENGTH;
CFE_EVS_SendEvent(CI_LAB_INGEST_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
"CI: cmd dropped - length mismatch, %lu (hdr) / %lu (packet)\n", (unsigned long)MsgSize,
(unsigned long)SourceSize);
}
else
{
Status = CFE_SUCCESS;
}

Close?

@dzbaker
Copy link
Collaborator

dzbaker commented Nov 15, 2023

Resolved by #152.

@dzbaker dzbaker closed this as completed Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants