提交 28a6fd93 编写于 作者: J Ján Tomko 提交者: Osier Yang

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.
上级 cb022152
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册