]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup-util: refuse the case that both path and suffix are empty strings
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 12 Feb 2022 06:32:48 +0000 (15:32 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 12 Feb 2022 11:01:52 +0000 (11:01 +0000)
Fixes CID#1322378.

src/basic/cgroup-util.c

index 1890cb09ff4a67e59cf67c6805f5734e101c9764..289e4fe073a9d31cbb393cb5ec86ed4027e6a2d3 100644 (file)
@@ -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))