mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-01 18:27:58 +02:00
input: fix access to invalid resource
the keyboard focus surface may not have a valid resource (server side surface or a surface surviving its client), so check if it is valid before using it. Acked-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
parent
0fd6d4ec53
commit
de77e32b10
1 changed files with 1 additions and 1 deletions
|
|
@ -1800,7 +1800,7 @@ seat_get_keyboard(struct wl_client *client, struct wl_resource *resource,
|
|||
seat->keyboard->focus_serial);
|
||||
}
|
||||
|
||||
if (seat->keyboard->focus &&
|
||||
if (seat->keyboard->focus && seat->keyboard->focus->resource &&
|
||||
wl_resource_get_client(seat->keyboard->focus->resource) == client) {
|
||||
struct weston_surface *surface =
|
||||
(struct weston_surface *) seat->keyboard->focus;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue