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>
This commit is contained in:
parent
b62dc4fcbc
commit
682c09a2ce
|
@ -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…
Reference in New Issue
Block a user