Skip to content

Commit

Permalink
lxccontainer: fix dereferenced pointer
Browse files Browse the repository at this point in the history
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
  • Loading branch information
2xsec authored and Christian Brauner committed Sep 30, 2018
1 parent 17dd7e6 commit 7a6e1cc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lxc/lxccontainer.c
Expand Up @@ -562,6 +562,9 @@ static int do_lxcapi_console_log(struct lxc_container *c, struct lxc_console_log
{
int ret;

if (!c)
return -EINVAL;

ret = lxc_cmd_console_log(c->name, do_lxcapi_get_config_path(c), log);
if (ret < 0) {
if (ret == -ENODATA)
Expand Down Expand Up @@ -4520,6 +4523,9 @@ WRAP_API(bool, lxcapi_snapshot_destroy_all)

static bool do_lxcapi_may_control(struct lxc_container *c)
{
if (!c)
return false;

return lxc_try_cmd(c->name, c->config_path) == 0;
}

Expand Down

0 comments on commit 7a6e1cc

Please sign in to comment.