mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00: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 <jolsa@kernel.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20201101233103.3537427-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
86449b12f6
commit
6311951d4f
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue