Skip to content

Commit

Permalink
cgroups: vet parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 2, 2021
1 parent bfe2971 commit b57f9b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lxc/cgroups/cgfsng.c
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit b57f9b1

Please sign in to comment.