]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
cgroups: Check if a valid name for child groups is passed
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 17 Aug 2022 08:21:19 +0000 (08:21 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 17 Aug 2022 08:21:19 +0000 (08:21 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/cgroup.c

index d295738ea0f190a760a3df326dc7439cb8963f79..2497bd21abc81be170c424c814ed58e4f760cef9 100644 (file)
@@ -533,6 +533,12 @@ int pakfire_cgroup_child(struct pakfire_cgroup** child,
        char path[PATH_MAX];
        int r;
 
+       // Check input
+       if (!name) {
+               errno = EINVAL;
+               return 1;
+       }
+
        // Join paths
        r = pakfire_path_join(path, cgroup->path, name);
        if (r < 0)