linux-stable/tools/lib
Ian Rogers 0d143f5217 libsubcmd: Fix memory leak in uniq()
[ Upstream commit ad30469a84 ]

uniq() will write one command name over another causing the overwritten
string to be leaked. Fix by doing a pass that removes duplicates and a
second that removes the holes.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Chenyuan Mi <cymi20@fudan.edu.cn>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20231208000515.1693746-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-23 08:12:51 +01:00
..
api tools api fs: Make xxx__mountpoint() more scalable 2020-06-22 09:05:12 +02:00
bpf libbpf: Fix alen calculation in libbpf_nla_dump_errormsg() 2023-03-11 16:31:37 +01:00
lockdep tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno' 2018-08-13 15:23:07 -03:00
subcmd libsubcmd: Fix memory leak in uniq() 2024-02-23 08:12:51 +01:00
symbol tools lib symbols: Introduce kallsyms__is_function() 2018-04-26 13:47:14 -03:00
traceevent libtraceevent: Fix build with binutils 2.35 2022-06-06 08:24:21 +02:00
bitmap.c
find_bit.c lib: optimize cpumask_next_and() 2018-02-06 18:32:44 -08:00
hweight.c
rbtree.c
str_error_r.c objtool, perf: Fix GCC 8 -Wrestrict error 2018-03-19 13:51:54 -03:00
string.c tools lib: Fix builds when glibc contains strlcpy() 2020-02-05 14:43:34 +00:00
vsprintf.c