diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2021-02-15 11:33:56 +0100 |
---|---|---|
committer | Olivier Fourdan <fourdan@gmail.com> | 2021-06-08 08:02:37 +0000 |
commit | 6272529339f975777f22bb0e6162ac43480ae257 (patch) | |
tree | 263541cac08965b8e2b91ff4856a3d1c2ffeda38 | |
parent | d41b43345cde2330648ad1890fb95bdbd5362f7f (diff) |
dix: Guard against non-existing PtrFeedbackPtr
Trying to change the pointer control settings on a device without
PtrFeedbackPtr would be a bug and a crash in the Xserver.
Guard against that case by returning early with a BadImplementation
error, that might kill the X11 client but the Xserver would survive.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Related: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1137
(cherry picked from commit dee2bb033e78e2f4aae7f5708c3d4fc74a9957de)
-rw-r--r-- | dix/devices.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c index 00c453980..e7c74d7b7 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -2261,6 +2261,9 @@ ProcChangePointerControl(ClientPtr client) REQUEST(xChangePointerControlReq); REQUEST_SIZE_MATCH(xChangePointerControlReq); + /* If the device has no PtrFeedbackPtr, the xserver has a bug */ + BUG_RETURN_VAL (!mouse->ptrfeed, BadImplementation); + ctrl = mouse->ptrfeed->ctrl; if ((stuff->doAccel != xTrue) && (stuff->doAccel != xFalse)) { client->errorValue = stuff->doAccel; |