]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
xenapi: Check for NULL before accessing the scheme
authorMatthias Bolte <matthias.bolte@googlemail.com>
Sun, 14 Mar 2010 20:29:06 +0000 (21:29 +0100)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 16 Mar 2010 19:17:45 +0000 (20:17 +0100)
src/xenapi/xenapi_driver.c

index 34b728a578c0f25042bf9c64450941f88836f742..6841246dcbc0b77999187de3b462f6189d8974a0 100644 (file)
@@ -88,7 +88,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;
     }