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>
dev
Daniel Stone 8 years ago committed by Bryce Harrington
parent a62d0468da
commit f81959e39d
  1. 3
      compositor/screen-share.c

@ -192,7 +192,7 @@ ss_seat_handle_keymap(void *data, struct wl_keyboard *wl_keyboard,
char *map_str; char *map_str;
if (!data) if (!data)
goto error; goto error_no_seat;
if (format == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { if (format == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) {
map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); 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: error:
wl_keyboard_release(seat->parent.keyboard); wl_keyboard_release(seat->parent.keyboard);
error_no_seat:
close(fd); close(fd);
} }

Loading…
Cancel
Save