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
This commit is contained in:
Daniel P. Berrange 2010-02-11 15:00:25 +00:00
parent 823a684f8d
commit 658341189b

View File

@ -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);