From 74c60fcbec9544b73e701158f80fea03282cd20d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 12 Feb 2022 15:32:48 +0900 Subject: [PATCH] cgroup-util: refuse the case that both path and suffix are empty strings Fixes CID#1322378. --- src/basic/cgroup-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) -- 2.47.3