All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf
@ 2020-11-01 23:31 Jiri Olsa
  2020-11-01 23:31 ` [PATCH 2/2] perf tools: Add missing swap for ino_generation Jiri Olsa
  2020-11-02 13:50 ` [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Namhyung Kim
  0 siblings, 2 replies; 5+ messages in thread
From: Jiri Olsa @ 2020-11-01 23:31 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, Peter Zijlstra, Ingo Molnar, Mark Rutland, Namhyung Kim,
	Alexander Shishkin, Michael Petlan, Ian Rogers, Stephane Eranian

We display garbage for undefined build_id objects,
because we don't initialize the output buffer.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/build-id.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index 8763772f1095..6b410c3d52dc 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -102,6 +102,8 @@ int build_id__sprintf(const struct build_id *build_id, char *bf)
 	const u8 *raw = build_id->data;
 	size_t i;
 
+	bf[0] = 0x0;
+
 	for (i = 0; i < build_id->size; ++i) {
 		sprintf(bid, "%02x", *raw);
 		++raw;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-03 12:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-01 23:31 [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Jiri Olsa
2020-11-01 23:31 ` [PATCH 2/2] perf tools: Add missing swap for ino_generation Jiri Olsa
2020-11-02 13:50   ` Namhyung Kim
2020-11-02 13:50 ` [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Namhyung Kim
2020-11-03 12:15   ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.