From: Yu Watanabe Date: Sat, 12 Feb 2022 06:32:48 +0000 (+0900) Subject: cgroup-util: refuse the case that both path and suffix are empty strings X-Git-Tag: v251-rc1~305 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74c60fcbec9544b73e701158f80fea03282cd20d;p=thirdparty%2Fsystemd.git cgroup-util: refuse the case that both path and suffix are empty strings Fixes CID#1322378. --- diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 1890cb09ff4..289e4fe073a 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))