nasa / CF

The Core Flight System (cFS) CFDP application.
Apache License 2.0
76 stars 45 forks source link

Decoding Segments using Incorrect Macro (CF_PDU_MAX_TLV) #363

Closed colteye closed 10 months ago

colteye commented 1 year ago

Checklist (Please check before submitting)

Code snips While checking out the most recent version of the CF repository to test with a custom file sending application, I ran into this line while trying to figure out why NAK's were acting strangely: https://github.com/nasa/CF/blob/19c18b9dbdb0093e9bea78322de777e8f282acfb/fsw/src/cf_codec.c#L1127

Shouldn't it look moreso like this? There are other lines referencing the CF_PDU_MAX_TLV macro, but those compare against the plseg->num_tlv struct member. When I modified it to this in my instance of cFS, all CFDP functions worked as expected:

if (plseg->num_segments >= CF_PDU_MAX_SEGMENTS)
skliper commented 1 year ago

@dmknutsen @jphickey - looks like a bug to me, thoughts?