xwayland: Fix crash when run with no input device
Starting an xterm with no input device led to a crash
because weston_wm_pick_seat() was returning garbage and
weston_wm_selection_init() was trying to use the garbage.
Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
diff --git a/xwayland/selection.c b/xwayland/selection.c
index 641ac49..9668d17 100644
--- a/xwayland/selection.c
+++ b/xwayland/selection.c
@@ -709,6 +709,8 @@
wm->atom.clipboard, mask);
seat = weston_wm_pick_seat(wm);
+ if (seat == NULL)
+ return;
wm->selection_listener.notify = weston_wm_set_selection;
wl_signal_add(&seat->selection_signal, &wm->selection_listener);