Re: [PATCHv2 7/7 util: Avoid Coverity FORWARD_NULL

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

 



On Wed, Jul 01, 2015 at 12:41:23 -0400, John Ferlan wrote:
> Avoid a false positive since Coverity find a path in virResizeN which
> could return 0 prior to the allocation of memory and thus flags a
> possible NULL dereference. Instead allocate the output buffer based
> on 'nparams' and only fill it partially if need be - shouldn't be too
> much a waste of space. Quicker than multiple VIR_RESIZE_N calls or
> two loops of STREQ's sandwiched around a single VIR_ALLOC_N using
> 'n' matches from a first loop to generate the 'n' addresses to return
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
> 
> Difference to v1: Use single VIR_ALLOC_N of nparams and one loop as
> suggested in review
> 
>  src/util/virtypedparam.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)

ACK,

Peter

Attachment: signature.asc
Description: 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]