Re: [PATCH] domain_addr: Resolve Coverity warning

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

 



On 06/21/14 13:54, John Ferlan wrote:
> Recent changes in the module :
> 
> http://www.redhat.com/archives/libvir-list/2014-June/msg00978.html
> 
> seem to have caused Coverity to "take a look"...
> 
> The virDomainCCWAddressAsString() API returns either a NULL or a string
> and the comparison of the returned value to "< 0" caused following errors:
> 
> [1] CONSTANT_EXPRESSION_RESULT
> (1) Event result_independent_of_operands:
>      "!(addr = virDomainCCWAddressAsString(&addrs->next)) < 0" is always
>      false regardless of the values of its operands. This occurs as the
>      logical operand of if.
> 
> and
> 
> 2] DEADCODE
> (1) Event between:
>      At condition "!(addr = virDomainCCWAddressAsString(&addrs->next)) < 0",
>      the value of "addr = virDomainCCWAddressAsString(&addrs->next)" must
>      be between 0 and 1.
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/conf/domain_addr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Although your version was first I like Jan's better as it's fixing two
issues of botched error checking of the function in question.

Peter


Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]