diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-04-27 20:19:05 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-04-27 20:19:05 -0400 |
commit | 48ea8f5470aa6f35244d1b218316705ea88c0259 (patch) | |
tree | b4e9a2d1cc227be96f2c3de815b5b2b4c12e3cb5 /tools/perf/util/symbol.c | |
parent | 23346f21b277e3aae5e9989e711a11cbe8133a45 (diff) |
perf machine: Pass buffer size to machine__mmap_name
Don't blindly assume that the size of the buffer is enough, use
snprintf.
Cc: Avi Kivity <avi@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Zhang, Yanmin <yanmin_zhang@linux.intel.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r-- | tools/perf/util/symbol.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index dc046368b5cf..c9c0bdd667ac 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -1856,7 +1856,7 @@ static int dso__load_guest_kernel_sym(struct dso *self, struct map *map, | |||
1856 | out_try_fixup: | 1856 | out_try_fixup: |
1857 | if (err > 0) { | 1857 | if (err > 0) { |
1858 | if (kallsyms_filename != NULL) { | 1858 | if (kallsyms_filename != NULL) { |
1859 | machine__mmap_name(machine, path); | 1859 | machine__mmap_name(machine, path, sizeof(path)); |
1860 | dso__set_long_name(self, strdup(path)); | 1860 | dso__set_long_name(self, strdup(path)); |
1861 | } | 1861 | } |
1862 | map__fixup_start(map); | 1862 | map__fixup_start(map); |
@@ -1961,8 +1961,8 @@ struct dso *dso__new_kernel(const char *name) | |||
1961 | static struct dso *dso__new_guest_kernel(struct machine *machine, | 1961 | static struct dso *dso__new_guest_kernel(struct machine *machine, |
1962 | const char *name) | 1962 | const char *name) |
1963 | { | 1963 | { |
1964 | char buff[PATH_MAX]; | 1964 | char bf[PATH_MAX]; |
1965 | struct dso *self = dso__new(name ?: machine__mmap_name(machine, buff)); | 1965 | struct dso *self = dso__new(name ?: machine__mmap_name(machine, bf, sizeof(bf))); |
1966 | 1966 | ||
1967 | if (self != NULL) { | 1967 | if (self != NULL) { |
1968 | dso__set_short_name(self, "[guest.kernel]"); | 1968 | dso__set_short_name(self, "[guest.kernel]"); |