summaryrefslogtreecommitdiff
path: root/src/basic/cgroup-util.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-02-12 15:32:48 +0900
committerLuca Boccassi <luca.boccassi@gmail.com>2022-02-12 11:01:52 +0000
commit74c60fcbec9544b73e701158f80fea03282cd20d (patch)
tree690f72d62b1aba1780103d3cbe2213641452024a /src/basic/cgroup-util.c
parentac3979abd7a38725b66c1ce0607fa905b3a3d782 (diff)
downloadsystemd-74c60fcbec9544b73e701158f80fea03282cd20d.tar.gz
cgroup-util: refuse the case that both path and suffix are empty strings
Fixes CID#1322378.
Diffstat (limited to 'src/basic/cgroup-util.c')
-rw-r--r--src/basic/cgroup-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index 1890cb09ff..289e4fe073 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -533,7 +533,7 @@ int cg_get_path(const char *controller, const char *path, const char *suffix, ch
/* If no controller is specified, we return the path *below* the controllers, without any
* prefix. */
- if (!path && !suffix)
+ if (isempty(path) && isempty(suffix))
return -EINVAL;
if (isempty(suffix))