mirror of
https://github.com/SCST-project/scst.git
synced 2026-10-22 14:12:33 +00:00
scst_main: Terminate trace output for an empty CDB
The saved Cppcheck report warns about the formatter output: scst/src/scst_main.c:637: warning: Uninitialized variable: buf [uninitvar] scst_dump_cdb does not write anything when cdb_len is zero, but scst_trace_cmds prints its stack buffer as a string. Unknown opcode groups can produce an empty CDB, so termination must not depend on valid command contents. Initialize nonempty output buffers and leave zero-capacity buffers untouched. Add KUnit coverage for empty, ordinary, truncated, one-byte and zero-size output. Include the new private test header in generated kernel patches.
This commit is contained in:
@@ -315,6 +315,7 @@ scst/src/scst_event.c scst/src/scst_event_priv.h scst/src/scst_no_dlm.c \
|
||||
scst/src/scst_test.h \
|
||||
scst/src/scst_event_test.h \
|
||||
scst/src/scst_dlm_test.h \
|
||||
scst/src/scst_main_test.h \
|
||||
scst/src/scst_copy_mgr_test.h"
|
||||
scst_05_targ="scst/src/scst_targ.c scst/src/scst_local_cmd.c \
|
||||
scst/src/scst_local_cmd.h \
|
||||
|
||||
Reference in New Issue
Block a user