From 09e80d0cc4c7d39c43ec0e6e910346d8e1b6461c Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Fri, 16 Sep 2016 20:26:31 -0600 Subject: [PATCH] c/r: check that cgroup_num_hierarchies > 0 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 --- src/lxc/criu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lxc/criu.c b/src/lxc/criu.c index 0702ad2f1..3e586b9d5 100644 --- a/src/lxc/criu.c +++ b/src/lxc/criu.c @@ -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++; -- 2.47.2