Skip to content

Commit c16d2f3

Browse files
committed
Fix #197, Initialize Variable msg_size in ci_lab_passthru_decode.c
1 parent a752c55 commit c16d2f3

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

fsw/src/ci_lab_passthru_decode.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@ CFE_Status_t CI_LAB_DecodeInputMessage(void *SourceBuffer, size_t SourceSize, CF
9292
else
9393
{
9494
MsgBufPtr = SourceBuffer;
95+
MsgSize = 0;
9596

9697
/* Check the size from within the header itself, compare against network buffer size */
97-
CFE_MSG_GetSize(&MsgBufPtr->Msg, &MsgSize);
98+
Status = CFE_MSG_GetSize(&MsgBufPtr->Msg, &MsgSize);
9899

99-
if (MsgSize > SourceSize)
100+
if ((Status == CFE_SUCCESS) && (MsgSize > SourceSize))
100101
{
101102
Status = CFE_STATUS_WRONG_MSG_LENGTH;
102103

@@ -106,10 +107,6 @@ CFE_Status_t CI_LAB_DecodeInputMessage(void *SourceBuffer, size_t SourceSize, CF
106107
(unsigned long)MsgSize,
107108
(unsigned long)SourceSize);
108109
}
109-
else
110-
{
111-
Status = CFE_SUCCESS;
112-
}
113110
}
114111

115112
*DestBufferOut = MsgBufPtr;

0 commit comments

Comments
 (0)