-
Notifications
You must be signed in to change notification settings - Fork 226
Description
Describe the bug
The ES application control functional test that verifies the CFE_ES_ReloadApp API using a null pointer for the filename generates a memory segmentation fault depending on the C99 implementation of the GLIBC library. When passing a null pointer for the filename in the CFE_ES_ReloadApp API eventually invokes vsnprintf with a null pointer, this behavior is undefined in C99 and depending on the GLIBC implementation will generate memory segmentation fault.
To Reproduce
Steps to reproduce the behavior:
- make ENABLE_UNIT_TESTS=true prep
- make
- make install
- Execute functional test on target.
Expected behavior
The ES application control functional test that verifies the CFE_ES_ReloadApp API should generate the CFE_ES_FILE_IO_ERR error code as expected when passed an invalid filename.
Code snips
The section of the functional test that's generating the fault:
| UtAssert_UINT32_EQ(CFE_ES_ReloadApp(TestAppId, NULL), CFE_ES_FILE_IO_ERR); |
The functional test should be modified to use an empty string instead of a null pointer such as:
UtAssert_UINT32_EQ(CFE_ES_ReloadApp(TestAppId, ""), CFE_ES_FILE_IO_ERR);
System observed on:
- Hardware: Raspberry Pi 4
- OS: [e.g. QNX 7.1]
- Versions [e.g. cFE 6.6, OSAL 4.2, PSP 1.3 for generic-qnx, any related apps]
Additional context
N/A
Reporter Info
Dwaine Molock - NASA/GSFC