[libvirt] [PATCH] qemu migration: avoid NULL-deref given an invalid input

Daniel Veillard veillard at redhat.com
Tue Dec 15 15:22:38 UTC 2009


On Mon, Dec 14, 2009 at 05:05:03PM +0100, Jim Meyering wrote:
> The fix here is to add the missing "goto".
> Nearly every other use of qemudReportError is followed
> closely by a goto or a return statement.
> 
> >From 898033ec5bb0399f7cc6a22ffd9f351552ced85b Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering at redhat.com>
> Date: Mon, 14 Dec 2009 17:02:56 +0100
> Subject: [PATCH] qemu migration: avoid NULL-deref given an invalid input
> 
> * src/qemu/qemu_driver.c (doNonTunnelMigrate): Don't let a
> NULL "uri_out" provoke a NULL-dereference in doNativeMigrate:
> supply omitted goto-after-qemudReportError.
> ---
>  src/qemu/qemu_driver.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index c782f0d..9ef6c35 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -7430,6 +7430,7 @@ static int doNonTunnelMigrate(virDomainPtr dom,
>      if (uri_out == NULL) {
>          qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
>                           _("domainMigratePrepare2 did not set uri"));
> +        goto cleanup;
>      }
> 
>      if (doNativeMigrate(dom, driver, vm, uri_out, flags, dname, resource) < 0)

  doNativeMigrate() really expect it's uri argument to be non-NULL,

   ACK

   thanks!

Daniel


-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list