lkml.org 
[lkml]   [2013]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 23/74] perf kvm: Initialize file_name var to fix segfault
On 01/25/2013 04:07 AM, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> The 3786063 commit:
>
> perf kvm: Rename perf_kvm to perf_kvm_stat
>
> Moved the file_name from inside a local struct var that initialized some
> of its members, thus zero initializing the not explicitely initialized
> variables, one of which was 'file_name', to a standalone local variable,
> but forgot to initialize it explicitely to NULL, so it then got some
> undefined value, causing a segfault in strdup when it wasn't, by luck,
> zero.
>
> Fix it by explicitely initializing it to NULL.

Thank you for fixing my fault.

Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>



\
 
 \ /
  Last update: 2013-01-25 04:41    [W:0.252 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site