mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
cgroup: fix impossible overrun in virCgroupAddTaskController
The size of the controllers array is VIR_CGROUP_CONTROLLER_LAST, however we only call it with values less than VIR_CGROUP_CONTROLLER_LAST.
This commit is contained in:
parent
cb02215252
commit
28a6fd9396
@ -814,7 +814,7 @@ int virCgroupAddTask(virCgroupPtr group, pid_t pid)
|
||||
*/
|
||||
int virCgroupAddTaskController(virCgroupPtr group, pid_t pid, int controller)
|
||||
{
|
||||
if (controller < 0 || controller > VIR_CGROUP_CONTROLLER_LAST)
|
||||
if (controller < 0 || controller >= VIR_CGROUP_CONTROLLER_LAST)
|
||||
return -EINVAL;
|
||||
|
||||
if (!group->controllers[controller].mountPoint)
|
||||
|
Loading…
x
Reference in New Issue
Block a user