mbox series

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

Message ID 20241029080117.625177-1-jmarchan@redhat.com (mailing list archive)
Headers show
Series trace-cmd: fix misc issues found by static analysis | expand

Message

Jerome Marchand Oct. 29, 2024, 8:01 a.m. UTC
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(-)