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:
parent
823a684f8d
commit
658341189b
@ -126,7 +126,8 @@ static virDrvOpenStatus lxcOpen(virConnectPtr conn,
|
|||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* If path isn't '/' then they typoed, tell them correct path */
|
/* 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,
|
lxcError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unexpected LXC URI path '%s', try lxc:///"),
|
_("Unexpected LXC URI path '%s', try lxc:///"),
|
||||||
conn->uri->path);
|
conn->uri->path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user