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

[libvirt] [PATCH 4/5] xen: Need to check validity of domain->conn before deref privateData



---
 src/xen/xen_hypervisor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index a770f53..ded1f0a 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -3284,7 +3284,7 @@ xenHypervisorGetDomainState(virDomainPtr domain,
                             int *reason,
                             unsigned int flags)
 {
-    xenUnifiedPrivatePtr priv = domain->conn->privateData;
+    xenUnifiedPrivatePtr priv;
     virDomainInfo info;
 
     virCheckFlags(0, -1);
@@ -3292,6 +3292,7 @@ xenHypervisorGetDomainState(virDomainPtr domain,
     if (domain->conn == NULL)
         return -1;
 
+    priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
     if (priv->handle < 0 || domain->id < 0)
         return -1;
 
-- 
1.7.11.7


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