mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 12:50:04 +01:00
dix: Clear device sprite after free in AttachDevice()
The code in AttachDevice() may free the dev->spriteInfo->sprite under
some circumstances and later call GetCurrentRootWindow() which uses
the same dev->spriteInfo->sprite.
While it seems unlikely that this is actually an issue, considering the
cases where one or the other get called, it still makes the code look
suspicious.
Make sure to clear set dev->spriteInfo->sprite to NULL immediately
after it's freed to avoid any confusion, even if only to clarify the
code.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1436
(cherry picked from commit e196535abb)
This commit is contained in:
parent
b2b3f67e09
commit
700ddafe0c
1 changed files with 1 additions and 0 deletions
|
|
@ -2627,6 +2627,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
|
|||
screen = miPointerGetScreen(dev);
|
||||
screen->DeviceCursorCleanup(dev, screen);
|
||||
free(dev->spriteInfo->sprite);
|
||||
dev->spriteInfo->sprite = NULL;
|
||||
}
|
||||
|
||||
dev->master = master;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue