Unverified Commit 264d40e5 by Christian Brauner Committed by Stéphane Graber

attach: move check for valid config earlier

Fixes: Coverity 1461735. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 10b15ed0
......@@ -1018,6 +1018,8 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
}
}
conf = init_ctx->container->lxc_conf;
if (!conf)
return log_error_errno(-EINVAL, EINVAL, "Missing container confifg");
if (!fetch_seccomp(init_ctx->container, options))
WARN("Failed to get seccomp policy");
......@@ -1275,7 +1277,7 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
TRACE("Sent LSM label file descriptor %d to child", labelfd);
}
if (conf && conf->seccomp.seccomp) {
if (conf->seccomp.seccomp) {
ret = lxc_seccomp_recv_notifier_fd(&conf->seccomp, ipc_sockets[0]);
if (ret < 0)
goto close_mainloop;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment