[libvirt] [PATCH] xenapi: Check for NULL before accessing the scheme

Matthias Bolte matthias.bolte at googlemail.com
Sun Mar 14 21:09:01 UTC 2010


---
 src/xenapi/xenapi_driver.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index 00b62b3..9a38e3f 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -87,7 +87,8 @@ xenapiOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUS
     char *password = NULL;
     struct _xenapiPrivate *privP = NULL;
 
-    if (STRCASENEQ(conn->uri->scheme, "XenAPI")) {
+    if (conn->uri == NULL || conn->uri->scheme == NULL ||
+        STRCASENEQ(conn->uri->scheme, "XenAPI")) {
         return VIR_DRV_OPEN_DECLINED;
     }
 
-- 
1.6.3.3




More information about the libvir-list mailing list