xenapi: Check for NULL before accessing the scheme

This commit is contained in:
Matthias Bolte 2010-03-14 21:29:06 +01:00
parent 2ed0b3f935
commit 2969eff86a

View 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;
}