nasa / cFE

The Core Flight System (cFS) Core Flight Executive (cFE)
Apache License 2.0
412 stars 202 forks source link

FS CFE_FS_ParseInputFileNameEx missing branch coverage (defensive condition check) #1883

Open skliper opened 3 years ago

skliper commented 3 years ago

Is your feature request related to a problem? Please describe. Non-independent conditions checked in CFE_FS_ParseInputFileNameEx: https://github.com/nasa/cFE/blob/5e41330979586bcdb113f491ea6c38ff9975fc72/modules/fs/fsw/src/cfe_fs_api.c#L441

Since when processing EXTENSION_COMPONENT (the case before END_COMPONENT) the InputPtr is set to NULL: https://github.com/nasa/cFE/blob/5e41330979586bcdb113f491ea6c38ff9975fc72/modules/fs/fsw/src/cfe_fs_api.c#L547-L558

Describe the solution you'd like Trade the usefulness of testing for an unreachable condition. It's "defensive" but only reachable by changing the implementation, although it can't cause harm.

Describe alternatives you've considered None

Additional context None

Requester Info Jacob Hageman - NASA/GSFC

avan989 commented 1 year ago

With the current implementation, the loop will exit before the Component reaches "END_COMPONENT" making this branch unreachable. Recommend closing tickets (and if needed open a new ticket to change implementation). @dmknutsen @dzbaker