Skip to content

Commit

Permalink
Fix #277, Fix format error and adjust unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
alanc-gsfc committed Aug 11, 2022
1 parent f4828f0 commit 7786054
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions fsw/src/cf_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,7 @@ int32 CF_CFDP_DecodeHeader(CF_DecoderState_t *state, CF_Logical_PduHeader_t *plh

/* Length is a simple 16-bit quantity and refers to the content after this header */
CF_Codec_Load_uint16(&(plh->data_encoded_length), &(peh->length));

if ((plh->eid_length > sizeof(plh->source_eid)) || (plh->txn_seq_length > sizeof(plh->sequence_num)))
if ((plh->eid_length > sizeof(plh->source_eid)) || (plh->txn_seq_length > sizeof(plh->sequence_num)))
{
ret = -1;
}
Expand Down
2 changes: 1 addition & 1 deletion unit-test/cf_codec_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ void Test_CF_CFDP_DecodeHeader(void)
CF_Logical_PduHeader_t out;
int32 ret_val;
const uint8 bytes[] = {0x3c, 0x01, 0x02, 0x00, 0x44, 0x55, 0x66};
const uint8 bad_input[] = {0x3c, 0x01, 0x02, 0x33, 0x44, 0x55, 0x66};
const uint8 bad_input[] = {0x3c, 0x01, 0x02, 0x77, 0x44, 0x55, 0x66};

/* fill with nonzero bytes so it is evident what was set */
memset(&out, 0xEE, sizeof(out));
Expand Down

0 comments on commit 7786054

Please sign in to comment.