diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2023-12-14 11:29:49 +1000 |
---|---|---|
committer | José Expósito <jose.exposito89@gmail.com> | 2024-01-16 09:23:47 +0100 |
commit | 9e2ecb2af8302dedc49cb6a63ebe063c58a9e7e3 (patch) | |
tree | 6f50a50a2825d22cba722965a9a147713d5b55f6 /Xi | |
parent | cad42fcb0850e001c7ae37179c8b94ccc42c0306 (diff) |
dix: allocate enough space for logical button maps
Both DeviceFocusEvent and the XIQueryPointer reply contain a bit for
each logical button currently down. Since buttons can be arbitrarily mapped
to anything up to 255 make sure we have enough bits for the maximum mapping.
CVE-2023-6816, ZDI-CAN-22664, ZDI-CAN-22665
This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/xiquerypointer.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c index 5b77b1a44..2b05ac5f3 100644 --- a/Xi/xiquerypointer.c +++ b/Xi/xiquerypointer.c @@ -149,8 +149,7 @@ ProcXIQueryPointer(ClientPtr client) if (pDev->button) { int i; - rep.buttons_len = - bytes_to_int32(bits_to_bytes(pDev->button->numButtons)); + rep.buttons_len = bytes_to_int32(bits_to_bytes(256)); /* button map up to 255 */ rep.length += rep.buttons_len; buttons = calloc(rep.buttons_len, 4); if (!buttons) |