diff options
author | Daniel Stone <daniels@collabora.com> | 2017-02-16 19:59:50 +0000 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2017-02-21 12:27:08 -0800 |
commit | f81959e39d8fd6835a55417496ec17696e3661db (patch) | |
tree | 97e50e5fff990d9e07df08dbd5f1e5fb3ad80809 | |
parent | a62d0468da944a750e3b7cf79b9859751c241cf9 (diff) |
screen-share: Avoid NULL dereference
Don't try to dereference the seat if it's NULL.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
-rw-r--r-- | compositor/screen-share.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compositor/screen-share.c b/compositor/screen-share.c index bcb9defa..069da1db 100644 --- a/compositor/screen-share.c +++ b/compositor/screen-share.c @@ -192,7 +192,7 @@ ss_seat_handle_keymap(void *data, struct wl_keyboard *wl_keyboard, char *map_str; if (!data) - goto error; + goto error_no_seat; if (format == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); @@ -235,6 +235,7 @@ ss_seat_handle_keymap(void *data, struct wl_keyboard *wl_keyboard, error: wl_keyboard_release(seat->parent.keyboard); +error_no_seat: close(fd); } |