lkml.org 
[lkml]   [2011]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [perf] Add inverted call graph report support.
On Thu, Jun 09, 2011 at 02:44:19PM +0800, Sam Liao wrote:
> --- a/tools/perf/util/session.c
> +++ b/tools/perf/util/session.c
> @@ -247,9 +247,14 @@ int perf_session__resolve_callchain(struct
> perf_session *self,
> callchain_cursor_reset(&self->callchain_cursor);
>
> for (i = 0; i < chain->nr; i++) {
> - u64 ip = chain->ips[i];
> + u64 ip;
> struct addr_location al;
>
> + if (callchain_param.order == ORDER_CALLEE)
> + ip = chain->ips[i];
> + else
> + ip = chain->ips[chain->nr - i - 1];

This can dereference a bad pointer if chain->nr == 0.

-Arun


\
 
 \ /
  Last update: 2011-06-09 21:35    [W:0.099 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site