提交 65834118 编写于 作者: D Daniel P. Berrange

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
上级 823a684f
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册