[libvirt] [libvirt-sandbox][PATCH 4/4] libvirt-sandbox-init-qemu: Check for fopen() return value

Daniel P. Berrange berrange at redhat.com
Wed Sep 23 09:20:46 UTC 2015


On Wed, Sep 23, 2015 at 11:15:24AM +0200, Michal Privoznik wrote:
> There's a problem in mount_root(): the return value of fopen() is
> not checked rather than used directly. Not only this interferes
> with pattern laid out by other areas of the code, but it's
> possibly dangerous too. If opening the config file fails, @fp may
> be dereferenced directly.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  libvirt-sandbox/libvirt-sandbox-init-qemu.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)

ACK


Regards,
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 :|




More information about the libvir-list mailing list