linux-stable/tools/lib/subcmd
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
..
Build
exec-cmd.c
exec-cmd.h
help.c libsubcmd: Fix memory leak in uniq() 2024-02-23 08:12:51 +01:00
help.h
Makefile libsubcmd: Use -O0 with DEBUG=1 2019-12-31 16:35:47 +01:00
pager.c
pager.h
parse-options.c
parse-options.h
run-command.c
run-command.h
sigchain.c
sigchain.h
subcmd-config.c
subcmd-config.h
subcmd-util.h libsubcmd: Fix use-after-free for realloc(..., 0) 2022-02-23 11:58:40 +01:00