mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 05:50:04 +01:00
Sync TouchListener memory allocation with population in TouchSetupListeners()
The allocated TouchListener array may fall short by 1 if hitting the worst case situation where there's an active grab, passive grabs on each window in the sprite trace and event selection for touch in one of the windows. This may lead to memory corruptions as the array is overflown. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
760be785eb
commit
ced56f322e
1 changed files with 2 additions and 2 deletions
|
|
@ -572,8 +572,8 @@ TouchBuildSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
|
|||
return FALSE;
|
||||
|
||||
/* Mark which grabs/event selections we're delivering to: max one grab per
|
||||
* window plus the bottom-most event selection. */
|
||||
ti->listeners = calloc(sprite->spriteTraceGood + 1, sizeof(*ti->listeners));
|
||||
* window plus the bottom-most event selection, plus any active grab. */
|
||||
ti->listeners = calloc(sprite->spriteTraceGood + 2, sizeof(*ti->listeners));
|
||||
if (!ti->listeners) {
|
||||
sprite->spriteTraceGood = 0;
|
||||
return FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue