mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-07 17:48:06 +02:00
clients: keyboard: Prevent NULL context in 'keyboard_handle_key'
It can happen that the input context is exited between a key press event and a key release event, as a result it is set to NULL. If the 'keyboard_handle_key' function is called in this case, this leads to a crash. To prevent this, the context is checked beforehand. Signed-off-by: Joscha.Wloch <Joscha.Wloch@bruker.com>
This commit is contained in:
parent
366d11c3ee
commit
74a7484ae6
1 changed files with 5 additions and 0 deletions
|
|
@ -620,6 +620,11 @@ append(char *s1, const char *s2)
|
|||
static void
|
||||
keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *key, uint32_t key_num, struct input *input, enum wl_pointer_button_state state)
|
||||
{
|
||||
if (keyboard->keyboard->context == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const char *label = NULL;
|
||||
|
||||
switch(keyboard->state) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue