From: Daniel P. Berrange Date: Thu, 11 Feb 2010 15:00:25 +0000 (+0000) Subject: Fix crash in LXC driver open method when URI has no path X-Git-Tag: v0.7.7~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=658341189beed7ef87974bbd4fd8d2b49d9b22b9;p=thirdparty%2Flibvirt.git Fix crash in LXC driver open method when URI has no path If giving a lxc:// URI instead of lxc:/// the open method would crash ona NULL pointer * src/lxc/lxc_driver.c: Cope with a NULL URI path --- diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 679e936648..f7e9c7d340 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -126,7 +126,8 @@ static virDrvOpenStatus lxcOpen(virConnectPtr conn, return VIR_DRV_OPEN_DECLINED; /* If path isn't '/' then they typoed, tell them correct path */ - if (STRNEQ(conn->uri->path, "/")) { + if (conn->uri->path != NULL && + STRNEQ(conn->uri->path, "/")) { lxcError(VIR_ERR_INTERNAL_ERROR, _("Unexpected LXC URI path '%s', try lxc:///"), conn->uri->path);