cgroups: stricter argument vetting for cgroup_attach()

parent 029d8e88
...@@ -3465,7 +3465,7 @@ int cgroup_attach(const struct lxc_conf *conf, const char *name, ...@@ -3465,7 +3465,7 @@ int cgroup_attach(const struct lxc_conf *conf, const char *name,
__do_close int unified_fd = -EBADF; __do_close int unified_fd = -EBADF;
int ret; int ret;
if (!conf || !name || !lxcpath || pid <= 0) if (!conf || is_empty_string(name) || !is_empty_string(lxcpath) || pid <= 0)
return ret_errno(EINVAL); return ret_errno(EINVAL);
unified_fd = lxc_cmd_get_cgroup2_fd(name, lxcpath); unified_fd = lxc_cmd_get_cgroup2_fd(name, lxcpath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment