mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 14:55:39 +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;
|
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);
|
||||||
|
Reference in New Issue
Block a user