summaryrefslogtreecommitdiff
path: root/tools/perf/util/debuginfo.c
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2025-07-24 09:32:45 -0700
committerNamhyung Kim <namhyung@kernel.org>2025-07-25 10:37:55 -0700
commiteee4b66105a6fa3b85fe5260d3791d607570ba95 (patch)
treed521b4d521e5091033baa765ca819fc03e7526ad /tools/perf/util/debuginfo.c
parent29be60c93d2d9300571230edaa484930cdbec437 (diff)
downloadlwn-eee4b66105a6fa3b85fe5260d3791d607570ba95.tar.gz
lwn-eee4b66105a6fa3b85fe5260d3791d607570ba95.zip
perf build-id: Ensure struct build_id is empty before use
If a build ID is read then not all code paths may ensure it is empty before use. Initialize the build_id to be zero-ed unless there is clear initialization such as a call to build_id__init. Signed-off-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20250724163302.596743-6-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/util/debuginfo.c')
-rw-r--r--tools/perf/util/debuginfo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/debuginfo.c b/tools/perf/util/debuginfo.c
index b5deea7cbdf2..a44c70f93156 100644
--- a/tools/perf/util/debuginfo.c
+++ b/tools/perf/util/debuginfo.c
@@ -103,7 +103,7 @@ struct debuginfo *debuginfo__new(const char *path)
char buf[PATH_MAX], nil = '\0';
struct dso *dso;
struct debuginfo *dinfo = NULL;
- struct build_id bid;
+ struct build_id bid = { .size = 0};
/* Try to open distro debuginfo files */
dso = dso__new(path);