mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 22:05:36 +00:00
cgroup: Use snprintf in move_in_cgroup
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
6ea8fb78a3
commit
e67ba97ebe
4
cgroup.c
4
cgroup.c
@@ -591,13 +591,13 @@ static int move_in_cgroup(CgSetEntry *se)
|
||||
name = ctrl->cnames[j] + 5;
|
||||
else
|
||||
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 ','. */
|
||||
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);
|
||||
err = fd = openat(cg, aux, O_WRONLY);
|
||||
|
Reference in New Issue
Block a user