From: Christian Brauner Date: Tue, 2 Feb 2021 20:59:04 +0000 (+0100) Subject: cgroups: vet parameters X-Git-Tag: lxc-5.0.0~305^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b57f9b131918c064b43cc371f3123492355b5c16;p=thirdparty%2Flxc.git cgroups: vet parameters Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 638e2f3c1..677b70cc6 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -3597,6 +3597,9 @@ bool cgroup_freeze(const char *name, const char *lxcpath, int timeout) __do_close int unified_fd = -EBADF; int ret; + if (is_empty_string(name) || is_empty_string(lxcpath)) + return ret_errno(EINVAL); + unified_fd = lxc_cmd_get_cgroup2_fd(name, lxcpath); if (unified_fd < 0) return ret_errno(ENOCGROUP2); @@ -3614,6 +3617,9 @@ bool cgroup_unfreeze(const char *name, const char *lxcpath, int timeout) __do_close int unified_fd = -EBADF; int ret; + if (is_empty_string(name) || is_empty_string(lxcpath)) + return ret_errno(EINVAL); + unified_fd = lxc_cmd_get_cgroup2_fd(name, lxcpath); if (unified_fd < 0) return ret_errno(ENOCGROUP2);