diff options
| author | Ian Rogers <irogers@google.com> | 2025-07-24 09:32:43 -0700 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2025-07-25 10:37:13 -0700 |
| commit | fccaaf6fbbc59910edcf276f97a5b2ef5778c55e (patch) | |
| tree | 9ec308fd5994e50fddb58ddf58f963d88eafbda7 /tools/perf/util/map.c | |
| parent | perf build-id: Truncate to avoid overflowing the build_id data (diff) | |
| download | linux-fccaaf6fbbc59910edcf276f97a5b2ef5778c55e.tar.gz linux-fccaaf6fbbc59910edcf276f97a5b2ef5778c55e.zip | |
perf build-id: Change sprintf functions to snprintf
Pass in a size argument rather than implying all build id strings must
be SBUILD_ID_SIZE.
Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250724163302.596743-4-irogers@google.com
[ fixed some build errors ]
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/util/map.c')
| -rw-r--r-- | tools/perf/util/map.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index d729438b7d65..0f6b185f9589 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -354,7 +354,7 @@ int map__load(struct map *map) if (dso__has_build_id(dso)) { char sbuild_id[SBUILD_ID_SIZE]; - build_id__sprintf(dso__bid(dso), sbuild_id); + build_id__snprintf(dso__bid(dso), sbuild_id, sizeof(sbuild_id)); pr_debug("%s with build id %s not found", name, sbuild_id); } else pr_debug("Failed to open %s", name); |
