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

Eric Blake eblake at redhat.com
Thu Apr 19 20:29:00 UTC 2012


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 at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120419/2450ae67/attachment-0001.sig>


More information about the libvir-list mailing list