]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Fix buffer overflow when processing list of controllers from command line (CVE-2011...
authorJan Safranek <jsafrane@redhat.com>
Tue, 1 Mar 2011 12:11:35 +0000 (13:11 +0100)
committerJan Safranek <jsafrane@redhat.com>
Tue, 1 Mar 2011 12:11:35 +0000 (13:11 +0100)
Thanks to Nelson Elhage for reporting this issue.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
src/tools/tools-common.c

index 4beffcd32cf2c8f89f863cea19ab5c9b12554769..7d633be404ae542383e214b0c45b7a72d68ec1aa 100644 (file)
@@ -79,7 +79,7 @@ int parse_cgroup_spec(struct cgroup_group_spec **cdptr, char *optarg,
                        }
                }
                j++;
-       } while (temp);
+       } while (temp && j<CG_CONTROLLER_MAX-1);
 
        /* Store path to the cgroup */
        strncpy(cdptr[i]->path, pathptr, FILENAME_MAX);