mirror of https://gitee.com/openkylin/linux.git
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
|
@ -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 New Issue