Xi: correct return buffer size for XIGetSelectedEvents.
The maximum number of bytes is calculated by the mask len, and the mask len is always in 4-byte units. XI2MASKSIZE however is in bytes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
fcf0c0b8f3
commit
5043f42f36
|
@ -202,7 +202,7 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer = xcalloc(MAXDEVICES, sizeof(xXIEventMask) + XI2MASKSIZE);
|
buffer = xcalloc(MAXDEVICES, sizeof(xXIEventMask) + ((XI2MASKSIZE + 3)/4) * 4);
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user