UtAssert_StringBufCompare
SEGV when -1 for size passed in (on CentOS 7)
#1237
Milestone
UtAssert_StringBufCompare
SEGV when -1 for size passed in (on CentOS 7)
#1237
Describe the bug
memchr(x, x, -1)
returns NULL on CentOS 7 (at least in one case), which withinUtAssert_StringBufCompare
causes thememcmp
to use the max size_t which causes a SEGV.osal/ut_assert/src/utassert.c
Lines 459 to 513 in fafb045
To Reproduce
Build and run this test case (others also use this pattern):
https://github.com/nasa/cFE/blob/a39b0a65fb2724692469ff492484b523fb4fa7e6/modules/config/ut-coverage/test_cfe_config.c#L138-L146
Expected behavior
No SEGV
Code snips
See above
System observed on:
Additional context
Add any other context about the problem here.
Reporter Info
Jacob Hageman - NASA/GSFC
The text was updated successfully, but these errors were encountered: