diff --git a/fsw/src/ci_lab_passthru_decode.c b/fsw/src/ci_lab_passthru_decode.c index 62d8745..e74e0e1 100644 --- a/fsw/src/ci_lab_passthru_decode.c +++ b/fsw/src/ci_lab_passthru_decode.c @@ -92,11 +92,12 @@ CFE_Status_t CI_LAB_DecodeInputMessage(void *SourceBuffer, size_t SourceSize, CF else { MsgBufPtr = SourceBuffer; + MsgSize = 0; /* Check the size from within the header itself, compare against network buffer size */ - CFE_MSG_GetSize(&MsgBufPtr->Msg, &MsgSize); + Status = CFE_MSG_GetSize(&MsgBufPtr->Msg, &MsgSize); - if (MsgSize > SourceSize) + if ((Status == CFE_SUCCESS) && (MsgSize > SourceSize)) { Status = CFE_STATUS_WRONG_MSG_LENGTH; @@ -106,10 +107,6 @@ CFE_Status_t CI_LAB_DecodeInputMessage(void *SourceBuffer, size_t SourceSize, CF (unsigned long)MsgSize, (unsigned long)SourceSize); } - else - { - Status = CFE_SUCCESS; - } } *DestBufferOut = MsgBufPtr;