]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
c/r: check that cgroup_num_hierarchies > 0 1194/head
authorTycho Andersen <tycho.andersen@canonical.com>
Sat, 17 Sep 2016 02:26:31 +0000 (20:26 -0600)
committerTycho Andersen <tycho.andersen@canonical.com>
Sat, 17 Sep 2016 02:26:31 +0000 (20:26 -0600)
Otherwise in the error case, we end up subtracting two from the
static_args, which would lead to a segfault :)

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
src/lxc/criu.c

index 0702ad2f1056f1f7b950d8e813bbaf4f75f36e4f..3e586b9d5e168d85c8c32edf2d7d8a68e17eb104 100644 (file)
@@ -191,7 +191,8 @@ static void exec_criu(struct criu_opts *opts)
                return;
        }
 
-       static_args += 2 * cgroup_num_hierarchies();
+       if (cgroup_num_hierarchies() > 0)
+               static_args += 2 * cgroup_num_hierarchies();
 
        if (opts->user->verbose)
                static_args++;