mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-07 18:10:03 +01:00
perf tools: Initialize output buffer in build_id__sprintf
We display garbage for undefined build_id objects, because we don't initialize the output buffer. Signed-off-by: Jiri Olsa <[email protected]> Acked-by: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
1 parent
86449b12f6
commit
6311951d4f
1 file changed
+2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user