[PATCH 2/3] virQEMUCapsNewBinary: Avoid NULL dereference
Daniel P. Berrangé
berrange at redhat.com
Mon Mar 30 11:02:36 UTC 2020
On Mon, Mar 30, 2020 at 11:24:59AM +0200, Michal Privoznik wrote:
> Even with GLib it is still possible for virQEMUCapsNew() to
> return NULL because it calls virQEMUCapsInitialize() which is a
> wrapper over pthread_once() which may fail. At least, we still
> check for its retval. If it so happens that the virQEMUCapsNew()
> fails and returns NULL, we should not dereference it.
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
> src/qemu/qemu_capabilities.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
More information about the libvir-list
mailing list