From 2969eff86aff45acb621a8aac4777b4318ba06fc Mon Sep 17 00:00:00 2001 From: Matthias Bolte Date: Sun, 14 Mar 2010 21:29:06 +0100 Subject: [PATCH] xenapi: Check for NULL before accessing the scheme --- src/xenapi/xenapi_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c index 34b728a57..6841246dc 100644 --- a/src/xenapi/xenapi_driver.c +++ b/src/xenapi/xenapi_driver.c @@ -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; } -- 2.39.5