Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754936Ab1FITdF (ORCPT ); Thu, 9 Jun 2011 15:33:05 -0400 Received: from outmail004.snc4.facebook.com ([66.220.144.136]:62122 "EHLO mx-out.facebook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754696Ab1FITdC (ORCPT ); Thu, 9 Jun 2011 15:33:02 -0400 Date: Thu, 9 Jun 2011 12:33:00 -0700 From: Arun Sharma To: Sam Liao Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Ingo Molnar Subject: Re: [PATCH] [perf] Add inverted call graph report support. Message-ID: <20110609193300.GA16858@dev1756.snc6.facebook.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 817 Lines: 25 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/