diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2010-04-14 18:39:42 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-04-14 16:41:21 -0400 |
commit | d3b63d7ae04879a817bac5c0bf09749f73629d32 (patch) | |
tree | 80501b4ed6110221160b9486dd24b480c3424f41 /tools/perf/util/probe-event.h | |
parent | dd259c5db26ccda46409dbf6efc79d5a2b259e38 (diff) |
perf probe: Fix a bug that --line range can be overflow
Since line_finder.lno_s/e are signed int but line_range.start/end
are unsigned int, it is possible to be overflow when converting
line_range->start/end to line_finder->lno_s/e.
This changes line_range.start/end and line_list.line to signed int
and adds overflow checks when setting line_finder.lno_s/e.
LKML-Reference: <20100414223942.14630.72730.stgit@localhost6.localdomain6>
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/probe-event.h')
-rw-r--r-- | tools/perf/util/probe-event.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h index ab5492901708..e7ff0d02c0d4 100644 --- a/tools/perf/util/probe-event.h +++ b/tools/perf/util/probe-event.h | |||
@@ -74,15 +74,15 @@ struct perf_probe_event { | |||
74 | /* Line number container */ | 74 | /* Line number container */ |
75 | struct line_node { | 75 | struct line_node { |
76 | struct list_head list; | 76 | struct list_head list; |
77 | unsigned int line; | 77 | int line; |
78 | }; | 78 | }; |
79 | 79 | ||
80 | /* Line range */ | 80 | /* Line range */ |
81 | struct line_range { | 81 | struct line_range { |
82 | char *file; /* File name */ | 82 | char *file; /* File name */ |
83 | char *function; /* Function name */ | 83 | char *function; /* Function name */ |
84 | unsigned int start; /* Start line number */ | 84 | int start; /* Start line number */ |
85 | unsigned int end; /* End line number */ | 85 | int end; /* End line number */ |
86 | int offset; /* Start line offset */ | 86 | int offset; /* Start line offset */ |
87 | char *path; /* Real path name */ | 87 | char *path; /* Real path name */ |
88 | struct list_head line_list; /* Visible lines */ | 88 | struct list_head line_list; /* Visible lines */ |