[libvirt] [PATCH] qemu: add return value check

Alex Jia ajia at redhat.com
Sat Sep 17 15:43:10 UTC 2011


On 09/17/2011 05:06 AM, Eric Blake wrote:
> On 09/16/2011 09:51 AM, ajia at redhat.com wrote:
>> From: Alex Jia<ajia at redhat.com>
>>
>> * src/qemu/qemu_command.c: missing return value check.
>>
>> Signed-off-by: Alex Jia<ajia at redhat.com>
>> ---
>>   src/qemu/qemu_command.c |    7 +++++--
>>   1 files changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
>> index 5f0de40..e8b1157 100644
>> --- a/src/qemu/qemu_command.c
>> +++ b/src/qemu/qemu_command.c
>> @@ -1702,7 +1702,8 @@ qemuBuildDriveDevStr(virDomainDiskDefPtr disk,
>>               virBufferAsprintf(&opt, ",event_idx=%s",
>>                                 
>> virDomainVirtioEventIdxTypeToString(disk->event_idx));
>>           }
>> -        qemuBuildDeviceAddressStr(&opt,&disk->info, qemuCaps);
>> +        if (qemuBuildDeviceAddressStr(&opt,&disk->info, qemuCaps)<  0)
>> +            goto error;
>
> ACK and pushed.  I'm assuming you found this with a static analyzer?
>
Hi Eric,
It seems ccc-analyzer keeps silence for this, so I'm trying Coverity to 
analyse codes,
the above issues are catched by Coverity.

BTW, I want to apply join coverity-users mail listing, and sent a email 
to Jeff cc to you & DV,
but I haven't received any reply, so I try to find some Coverity 
resources myself and
run it on libvirt source codes.

Thanks & Regards,
Alex




More information about the libvir-list mailing list