From: Christian Brauner Date: Fri, 3 Sep 2021 09:03:07 +0000 (+0200) Subject: criu: fix integer comparisons X-Git-Tag: lxc-4.0.11~128 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=945f12ebeb89eb97d9f2764a5b20a9ddaa8ae25c;p=thirdparty%2Flxc.git criu: fix integer comparisons Signed-off-by: Christian Brauner --- diff --git a/src/lxc/criu.c b/src/lxc/criu.c index f93cfa6be..ea21640e5 100644 --- a/src/lxc/criu.c +++ b/src/lxc/criu.c @@ -337,7 +337,7 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf, WARN("No cgroup controllers configured in container's cgroup %s", cgroup_base_path); ret = sprintf(buf, "%s", cgroup_base_path); } - if (ret < 0 || ret >= sizeof(buf)) + if (ret < 0 || (size_t)ret >= sizeof(buf)) return log_error_errno(-EIO, EIO, "sprintf of cgroup root arg failed"); DECLARE_ARG("--cgroup-root"); @@ -445,7 +445,7 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf, char ghost_limit[32]; ret = sprintf(ghost_limit, "%"PRIu64, opts->user->ghost_limit); - if (ret < 0 || ret >= sizeof(ghost_limit)) + if (ret < 0 || (size_t)ret >= sizeof(ghost_limit)) return log_error_errno(-EIO, EIO, "Failed to print ghost limit %"PRIu64, opts->user->ghost_limit); DECLARE_ARG("--ghost-limit");