From 6ea8fb78a3f1267ce4bb2f91ef520232a5c00aed Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Mon, 21 Jul 2014 14:47:05 +0400 Subject: [PATCH] cgroup: Use snprintf in collect_cgroups Signed-off-by: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- cgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cgroup.c b/cgroup.c index 6e7269f35..6661a4a89 100644 --- a/cgroup.c +++ b/cgroup.c @@ -291,10 +291,10 @@ static int collect_cgroups(struct list_head *ctls) if (strstartswith(cc->name, "name=")) { name = cc->name + 5; - sprintf(opts, "none,%s", cc->name); + snprintf(opts, sizeof(opts), "none,%s", cc->name); } else { name = cc->name; - sprintf(opts, "%s", name); + snprintf(opts, sizeof(opts), "%s", name); } if (mkdtemp(prefix) == NULL) {