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

Re: [libvirt] [PATCH 7/8] vmware: avoid null deref on failed lookup



At 2011-7-2 7:36, Eric Blake write:
Detected by Coverity.

* src/vmware/vmware_driver.c (vmwareDomainReboot): Check error
before dereferencing memory.
---
  src/vmware/vmware_driver.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c
index 5e2c4ba..52582d6 100644
--- a/src/vmware/vmware_driver.c
+++ b/src/vmware/vmware_driver.c
@@ -461,7 +461,6 @@ vmwareDomainReboot(virDomainPtr dom, unsigned int flags ATTRIBUTE_UNUSED)
      vmwareDriverLock(driver);
      vm = virDomainFindByUUID(&driver->domains, dom->uuid);
      vmwareDriverUnlock(driver);
-    vmxPath = ((vmwareDomainPtr) vm->privateData)->vmxPath;

      if (!vm) {
          vmwareError(VIR_ERR_NO_DOMAIN, "%s",
@@ -469,6 +468,7 @@ vmwareDomainReboot(virDomainPtr dom, unsigned int flags ATTRIBUTE_UNUSED)
          goto cleanup;
      }

+    vmxPath = ((vmwareDomainPtr) vm->privateData)->vmxPath;
      vmwareSetSentinal(cmd, vmw_types[driver->type]);
      vmwareSetSentinal(cmd, vmxPath);

ACK


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