Commit e67ba97e authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

cgroup: Use snprintf in move_in_cgroup

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 6ea8fb78
...@@ -591,13 +591,13 @@ static int move_in_cgroup(CgSetEntry *se) ...@@ -591,13 +591,13 @@ static int move_in_cgroup(CgSetEntry *se)
name = ctrl->cnames[j] + 5; name = ctrl->cnames[j] + 5;
else else
name = ctrl->cnames[j]; name = ctrl->cnames[j];
aux_off += sprintf(aux + aux_off, "%s,", name); aux_off += snprintf(aux + aux_off, sizeof(aux) - aux_off, "%s,", name);
} }
/* Chop off the last ','. */ /* Chop off the last ','. */
aux_off -= 1; aux_off -= 1;
sprintf(aux + aux_off, "/%s/tasks", ce->path); snprintf(aux + aux_off, sizeof(aux) - aux_off, "/%s/tasks", ce->path);
pr_debug(" `-> %s\n", aux); pr_debug(" `-> %s\n", aux);
err = fd = openat(cg, aux, O_WRONLY); err = fd = openat(cg, aux, O_WRONLY);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment