diff options
| author | Ian Rogers <irogers@google.com> | 2025-07-24 09:32:45 -0700 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2025-07-25 10:37:55 -0700 |
| commit | eee4b66105a6fa3b85fe5260d3791d607570ba95 (patch) | |
| tree | d521b4d521e5091033baa765ca819fc03e7526ad /tools/perf/bench/inject-buildid.c | |
| parent | 29be60c93d2d9300571230edaa484930cdbec437 (diff) | |
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/bench/inject-buildid.c')
| -rw-r--r-- | tools/perf/bench/inject-buildid.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/bench/inject-buildid.c b/tools/perf/bench/inject-buildid.c index f55c07e4be94..aad572a78d7f 100644 --- a/tools/perf/bench/inject-buildid.c +++ b/tools/perf/bench/inject-buildid.c @@ -80,7 +80,7 @@ static int add_dso(const char *fpath, const struct stat *sb __maybe_unused, int typeflag, struct FTW *ftwbuf __maybe_unused) { struct bench_dso *dso = &dsos[nr_dsos]; - struct build_id bid; + struct build_id bid = { .size = 0, }; if (typeflag == FTW_D || typeflag == FTW_SL) return 0; |
