]> git.hungrycats.org Git - linux/commit
perf dwarf-aux: Fix off-by-one in die_get_varname()
authorNamhyung Kim <namhyung@kernel.org>
Mon, 12 Jun 2023 23:41:01 +0000 (16:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jul 2023 17:39:47 +0000 (19:39 +0200)
commit5fb285b8c97b920d483eb593cc919bad7452d31c
treecfdd191a7a2b8ba2c155e14c252e3e0656014ae7
parent318b1febc84d7fea6f74672cf69d756e6c3b584a
perf dwarf-aux: Fix off-by-one in die_get_varname()

[ Upstream commit 3abfcfd847717d232e36963f31a361747c388fe7 ]

The die_get_varname() returns "(unknown_type)" string if it failed to
find a type for the variable.  But it had a space before the opening
parenthesis and it made the closing parenthesis cut off due to the
off-by-one in the string length (14).

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Fixes: 88fd633cdfa19060 ("perf probe: No need to use formatting strbuf method")
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230612234102.3909116-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/util/dwarf-aux.c