Skip to content

trace-cmd: fix misc issues found by static analysis

Jerome Marchand linux-trace-devel 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 0 repliesNew
  2. v14 patches 1 replySuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8trace-cmd lib: Prevent a memory leak in handle_options()lib/trace-cmd/trace-input.c+3 -40 replies
2/8trace-cmd record: Prevent a memory leak in show_error()tracecmd/trace-record.c+1 -00 replies
3/8trace-cmd lib: Check the return value of do_lseek() in trace_get_options()lib/trace-cmd/trace-output.c+2 -00 replies
4/8trace-cmd dump: Prevent buffer overrun in dump_clock()tracecmd/trace-dump.c+1 -10 replies
5/8trace-cmd record: Prevent memory leak in setup_network()tracecmd/trace-record.c+2 -00 replies
6/8trace-cmd lib: Prevent memory leak in tracecmd_create_event_hook()lib/trace-cmd/trace-hooks.c+2 -00 replies
7/8trace-cmd mem: Prevent a memory leak in trace_mem()tracecmd/trace-mem.c+2 -40 replies
8/8trace-cmd record: Check the length of the protocol version receivedtracecmd/trace-record.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH 0/8 v2] trace-cmd: fix misc issues found by static analysis

A number of issues were found by running static analysers on the code of trace-cmd with openscanhub[1]. Mostly ressource leak, but some are more serious like memory corruption.

[1] https://fedoraproject.org/wiki/OpenScanHub

Jerome Marchand (8):
trace-cmd lib: Prevent a memory leak in handle_options() trace-cmd record: Prevent a memory leak in show_error() trace-cmd lib: Check the return value of do_lseek() in
trace_get_options()
trace-cmd dump: Prevent buffer overrun in dump_clock() trace-cmd record: Prevent memory leak in setup_network() trace-cmd lib: Prevent memory leak in tracecmd_create_event_hook() trace-cmd mem: Prevent a memory leak in trace_mem() trace-cmd record: Check the length of the protocol version received

 lib/trace-cmd/trace-hooks.c  | 2 ++
 lib/trace-cmd/trace-input.c  | 7 +++----
 lib/trace-cmd/trace-output.c | 2 ++
 tracecmd/trace-dump.c        | 2 +-
 tracecmd/trace-mem.c         | 6 ++----
 tracecmd/trace-record.c      | 5 ++++-
 6 files changed, 14 insertions(+), 10 deletions(-)
Signature · 1 line
2.47.0