You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default size of the "EventText" string is 32, but the unit test had
hard coded string sizes of 50 chars, which will overflow the buffer.
Use "sizeof" operator to adjust to the actual size of the destination to
correct the issue.
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:LC/unit-test/lc_action_tests.c
Line 233 in 779b903
However in the default platform config the size is only 32:
LC/fsw/inc/lc_platform_cfg.h
Line 228 in 779b903
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.
The text was updated successfully, but these errors were encountered: