mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-16 06:10:32 +01: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
b22783f483
commit
befa8a3b83
1 changed files with 2 additions and 2 deletions
|
|
@ -409,7 +409,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);
|
||||
|
|
@ -428,7 +428,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