]> code.ossystems Code Review - meta-freescale.git/commitdiff
weston: xwayland: Fix crash when run with no input device
authorTom Hochstein <tom.hochstein@nxp.com>
Mon, 16 Jan 2017 19:52:24 +0000 (13:52 -0600)
committerOtavio Salvador <otavio@ossystems.com.br>
Wed, 25 Jan 2017 16:28:30 +0000 (14:28 -0200)
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.

Upstream-Status: Accepted [https://cgit.freedesktop.org/wayland/weston/commit/?id=e7fff215ada3fd3d1b2af664888f960c082f9065]

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
recipes-graphics/wayland/weston/0019-xwayland-Fix-crash-when-run-with-no-input-device.patch [new file with mode: 0644]
recipes-graphics/wayland/weston_%.bbappend

diff --git a/recipes-graphics/wayland/weston/0019-xwayland-Fix-crash-when-run-with-no-input-device.patch b/recipes-graphics/wayland/weston/0019-xwayland-Fix-crash-when-run-with-no-input-device.patch
new file mode 100644 (file)
index 0000000..1304cef
--- /dev/null
@@ -0,0 +1,45 @@
+From 60f8817f371123b9c36b3ff1120eec1e8f9e3d10 Mon Sep 17 00:00:00 2001
+From: Tom Hochstein <tom.hochstein@nxp.com>
+Date: Mon, 31 Oct 2016 19:21:58 -0500
+Subject: [PATCH weston] 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>
+---
+ xwayland/selection.c      | 10 +++++++---
+ xwayland/window-manager.c |  6 ++++--
+ 2 files changed, 11 insertions(+), 5 deletions(-)
+
+Index: weston-1.11.0/xwayland/selection.c
+===================================================================
+--- weston-1.11.0.orig/xwayland/selection.c    2016-05-19 16:36:04.000000000 -0500
++++ weston-1.11.0/xwayland/selection.c 2016-11-01 14:32:48.000000000 -0500
+@@ -708,6 +708,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);
+Index: weston-1.11.0/xwayland/window-manager.c
+===================================================================
+--- weston-1.11.0.orig/xwayland/window-manager.c       2016-05-19 16:36:04.000000000 -0500
++++ weston-1.11.0/xwayland/window-manager.c    2016-11-01 11:47:14.549606964 -0500
+@@ -1303,8 +1303,10 @@
+ struct weston_seat *
+ weston_wm_pick_seat(struct weston_wm *wm)
+ {
+-      return container_of(wm->server->compositor->seat_list.next,
+-                          struct weston_seat, link);
++      struct wl_list *seats = wm->server->compositor->seat_list.next;
++      if (wl_list_empty(seats))
++              return NULL;
++      return container_of(seats, struct weston_seat, link);
+ }
+ static struct weston_seat *
index 8a47ba52f81bf0889e8c84c6a777d665b731e9bd..dfd7da4498b26d0ff67a04d4a87e52d6464ea698 100644 (file)
@@ -19,6 +19,10 @@ SRC_URI_append_imxgpu3d = " \
     file://0018-MGS-2397-ccc-Enable-double-buffer-with-fb_pan_displa.patch \
 "
 
+SRC_URI_append = " \
+    file://0019-xwayland-Fix-crash-when-run-with-no-input-device.patch     \
+"
+
 # The 'egl' configuration of weston requires gles support, and consideration
 # must be taken for the different SoC capabilities:
 # - For SoCs with 3d support, imx-gpu-viv provides hardware-accelerated