Re: [PATCH] remote: avoid null dereference on error

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

 



On Tue, May 03, 2011 at 11:28:30AM -0600, Eric Blake wrote:
> Clang found three instances of uninitialized use of nparams in
> the cleanup path.  Unfortunately, one is a false positive: clang
> couldn't see that ret->params.params_val is guaranteed to be
> NULL unless allocated within a function, and that nparams is
> guaranteed to be assigned prior to the allocation; hoisting the
> assignment to nparams to be earlier in the function shuts up
> that false positive.  But two of the reports also happened to
> highlight a real bug - the error path can dereference NULL.
> 
> * daemon/remote.c (remoteDispatchDomainGetMemoryParameters)
> (remoteDispatchDomainGetBlkioParameters): Don't clear fields if
> array was not allocated.
> (remoteDispatchDomainGetSchedulerParameters): Initialize nparams
> earlier.
> ---
>  daemon/remote.c |   29 ++++++++++++++++-------------
>  1 files changed, 16 insertions(+), 13 deletions(-)

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|
--
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]