Closed jphickey closed 1 year ago
Checklist (Please check before submitting)
Describe the bug The unit test code sets the EventText member with a call to strncpy and a hardcoded size here: https://github.com/nasa/LC/blob/779b903faef553299d8130aded0b9f5133ffa8c5/unit-test/lc_action_tests.c#L233
EventText
However in the default platform config the size is only 32: https://github.com/nasa/LC/blob/779b903faef553299d8130aded0b9f5133ffa8c5/fsw/inc/lc_platform_cfg.h#L228
To Reproduce Build and run using default/out-of-box config.
Expected behavior Example configuration should not trigger buffer overflow
Additional context Consider using sizeof() operator here, to adapt the strncpy call to the real size of the target buffer.
sizeof()
strncpy
Reporter Info Joseph Hickey, Vantage Systems, Inc.
Checklist (Please check before submitting)
Describe the bug The unit test code sets the
EventText
member with a call to strncpy and a hardcoded size here: https://github.com/nasa/LC/blob/779b903faef553299d8130aded0b9f5133ffa8c5/unit-test/lc_action_tests.c#L233However in the default platform config the size is only 32: https://github.com/nasa/LC/blob/779b903faef553299d8130aded0b9f5133ffa8c5/fsw/inc/lc_platform_cfg.h#L228
To Reproduce Build and run using default/out-of-box config.
Expected behavior Example configuration should not trigger buffer overflow
Additional context Consider using
sizeof()
operator here, to adapt thestrncpy
call to the real size of the target buffer.Reporter Info Joseph Hickey, Vantage Systems, Inc.