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:
committed by
Pekka Paalanen
parent
0fd6d4ec53
commit
de77e32b10
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user