]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxccontainer: fix dereferenced pointer 2589/head
author2xsec <dh48.jeong@samsung.com>
Thu, 6 Sep 2018 07:55:10 +0000 (16:55 +0900)
committer2xsec <dh48.jeong@samsung.com>
Thu, 6 Sep 2018 07:55:10 +0000 (16:55 +0900)
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
src/lxc/lxccontainer.c

index cdd1642026949da000e2a394e0d2d77d1125faff..31b91089762b8ab42e1ed7e1b518cee63ff6b463 100644 (file)
@@ -583,6 +583,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)
@@ -4548,6 +4551,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;
 }