mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-06 10:28:03 +02:00
Xi: avoid overrun of callback array.
This code had an off-by-one and would allow writing one past the end of
the callbacks array.
Pointed out by coverity.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 682c09a2ce)
This commit is contained in:
parent
87efcf9c17
commit
bd449cc5db
1 changed files with 2 additions and 2 deletions
|
|
@ -411,7 +411,7 @@ static int
|
|||
ProcIDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
if (stuff->data > ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
|
||||
if (stuff->data >= ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
|
||||
return BadRequest;
|
||||
|
||||
return (*ProcIVector[stuff->data])(client);
|
||||
|
|
@ -430,7 +430,7 @@ static int
|
|||
SProcIDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
if (stuff->data > ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
|
||||
if (stuff->data >= ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
|
||||
return BadRequest;
|
||||
|
||||
return (*SProcIVector[stuff->data])(client);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue