Commit dcd1e262 by Tycho Andersen Committed by Stéphane Graber

fix NULL dereference

lxc_console dereferences C, so we should check that it is not null and fail if it is. Reported-by: Coverity Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 284c4b01
......@@ -463,7 +463,11 @@ static int lxcapi_console(struct lxc_container *c, int ttynum, int stdinfd,
{
int ret;
struct lxc_conf *old = current_config;
current_config = c ? c->lxc_conf : NULL;
if (!c)
return -1;
current_config = c->lxc_conf;
ret = lxc_console(c, ttynum, stdinfd, stdoutfd, stderrfd, escape);
current_config = old;
return ret;
......
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