[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCHv2] virsh: avoid uninitialized memory usage



On 04/19/2012 02:56 AM, Wen Congyang wrote:
> At 04/19/2012 04:51 PM, Alex Jia Wrote:
>> Detected by valgrind.
>>
>> * tools/virsh.c (cmdBlockPull): fix uninitialized memory usage.
>>  

>> +++ b/tools/virsh.c
>> @@ -7634,6 +7634,7 @@ cmdBlockPull(vshControl *ctl, const vshCmd *cmd)
>>  
>>          intCaught = 0;
>>          sig_action.sa_sigaction = vshCatchInt;
>> +        sig_action.sa_flags = 0;
>>          sigemptyset(&sig_action.sa_mask);
>>          sigaction(SIGINT, &sig_action, &old_sig_action);
>>  
> 
> ACK

NACK.  vshCatchInt is a 3-arg function, and therefore
sig_action.sa_flags must include at least SA_SIGINFO.  I inadvertently
missed a line when copying code from vshWatchJob(); I'll push the
obvious v3 patch shortly.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]