diff options
author | Jiri Olsa <jolsa@redhat.com> | 2012-08-01 08:47:57 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-08-01 17:42:22 -0400 |
commit | 028df76726c5637c6f70a064d94452808ec74f9e (patch) | |
tree | 31143c7f82b00d23b641a92015db0d6ae015a8ce /tools/perf/util/symbol.c | |
parent | 30f31c0a492d0c1cd64af631476697f38d6a79d4 (diff) |
perf symbols: Fix array sizes for binary types arrays
Following commit introduced wrong array boundaries, that could lead to
SIGSEGV.
perf symbols: Factor DSO symtab types to generic binary types
commit 44f24cb3156a1e7d2b6bb501b7f6153aed08994c
Author: Jiri Olsa <jolsa@redhat.com>
Fixing to use proper array size.
Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
Link: http://lkml.kernel.org/r/1343825277-10517-1-git-send-email-jolsa@redhat.com
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 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index fdad4eeeb429..fe86612afadc 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -64,7 +64,7 @@ static enum dso_binary_type binary_type_symtab[] = { | |||
64 | DSO_BINARY_TYPE__NOT_FOUND, | 64 | DSO_BINARY_TYPE__NOT_FOUND, |
65 | }; | 65 | }; |
66 | 66 | ||
67 | #define DSO_BINARY_TYPE__SYMTAB_CNT sizeof(binary_type_symtab) | 67 | #define DSO_BINARY_TYPE__SYMTAB_CNT ARRAY_SIZE(binary_type_symtab) |
68 | 68 | ||
69 | static enum dso_binary_type binary_type_data[] = { | 69 | static enum dso_binary_type binary_type_data[] = { |
70 | DSO_BINARY_TYPE__BUILD_ID_CACHE, | 70 | DSO_BINARY_TYPE__BUILD_ID_CACHE, |
@@ -72,7 +72,7 @@ static enum dso_binary_type binary_type_data[] = { | |||
72 | DSO_BINARY_TYPE__NOT_FOUND, | 72 | DSO_BINARY_TYPE__NOT_FOUND, |
73 | }; | 73 | }; |
74 | 74 | ||
75 | #define DSO_BINARY_TYPE__DATA_CNT sizeof(binary_type_data) | 75 | #define DSO_BINARY_TYPE__DATA_CNT ARRAY_SIZE(binary_type_data) |
76 | 76 | ||
77 | int dso__name_len(const struct dso *dso) | 77 | int dso__name_len(const struct dso *dso) |
78 | { | 78 | { |