]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup: fix potential bad memory access
authorLennart Poettering <lennart@poettering.net>
Thu, 3 Sep 2015 17:43:15 +0000 (19:43 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 4 Sep 2015 07:07:31 +0000 (09:07 +0200)
src/basic/cgroup-util.c

index bf897c9b2dc4d78757111d832b615e41ff3a6ab4..77375f366954fa5c53b7684b0c24d6e9679139d4 100644 (file)
@@ -518,9 +518,9 @@ int cg_get_path(const char *controller, const char *path, const char *suffix, ch
                 if (!path && !suffix)
                         return -EINVAL;
 
-                if (isempty(suffix))
+                if (!suffix)
                         t = strdup(path);
-                else if (isempty(path))
+                else if (!path)
                         t = strdup(suffix);
                 else
                         t = strjoin(path, "/", suffix, NULL);