]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl: avoid a dereference of a null pointer
authorAlex Jia <ajia@redhat.com>
Sun, 4 Sep 2011 17:01:03 +0000 (01:01 +0800)
committerEric Blake <eblake@redhat.com>
Thu, 8 Sep 2011 10:00:30 +0000 (11:00 +0100)
Variable 'l_disk' initialized to a null pointer value, control jumps to 'case
VIR_DOMAIN_DISK_DEVICE_DISK and then taking false branch, Within the expansion
of the macro 'libxlError': Field access results in a dereference of a null
pointer (loaded from variable 'l_disk').

* src/libxl/libxl_driver.c: Field access results in a dereference of a null
  pointer (loaded from variable 'l_disk')

Signed-off-by: Alex Jia <ajia@redhat.com>
src/libxl/libxl_driver.c

index 4302c8be93506b0380eceb9bd6d54c71e3c26d9a..d324632b2b7b36c42c3bceffaa9e32bf93896593 100644 (file)
@@ -3017,7 +3017,7 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
             } else {
                 libxlError(VIR_ERR_CONFIG_UNSUPPORTED,
                         _("disk bus '%s' cannot be hot unplugged."),
-                        virDomainDiskBusTypeToString(l_disk->bus));
+                        virDomainDiskBusTypeToString(dev->data.disk->bus));
             }
             break;
         default: