Closed chillfig closed 2 years ago
The strange part here is FM_DirListEntry_t EntryName is of size OS_MAX_PATH_LEN, yet the EntryLength is limited by os_dirent_t Filename size of OS_MAX_FILE_NAME as long as it's NULL terminated (which it is). https://github.com/nasa/FM/blob/51707f20350e4ea909842acb3597fff8da3ab18e/fsw/src/fm_msg.h#L317-L323 https://github.com/nasa/osal/blob/2864b25fafdd314e09d5406d8f2a03369550a4aa/src/os/inc/osapi-dir.h#L32-L35
Note LocalName is also OS_MAX_PATH_LEN: https://github.com/nasa/FM/blob/51707f20350e4ea909842acb3597fff8da3ab18e/fsw/src/fm_child.c#L1199
I vote for removing the check.
Checklist (Please check before submitting)
Describe the bug
OS_MAX_FILE_NAME
is immutable in testing code coverage. Therefore, full branch coverage starting on line 1275 below is not possible.Example Code Coverage result:
To Reproduce The following expression can't be achieved:
EntryLength > sizeof(ListEntry->EntryName
)https://github.com/nasa/FM/blob/51707f20350e4ea909842acb3597fff8da3ab18e/fsw/src/fm_child.c#L1275-L1291
Expected behavior 100% coverage.
Code snips See code snip above
System observed on: Continuous Integration
Additional context Add any other context about the problem here.
Reporter Info Justin Figueroa, ASRC Federal