[PATCH weston] fix SIGSEGV in Weston data_device_start_drag() during, weston-dnd

m.budzynski m.budzynski at samsung.com
Fri Jun 6 07:28:11 PDT 2014


Hi,

This is a trivial fix for SIGSEGV described in 
https://bugs.freedesktop.org/show_bug.cgi?id=79725 occurring due to null 
pointer dereference. Currently I do not have enough knowledge about the 
protocol itself to be certain if this is not a deeper bug down the line 
requiring an assertion here and more involved fix deeper in the input 
handling. I would be glad to investigate this issue further if it is in 
fact the case.

Best regards,

---
  src/data-device.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/data-device.c b/src/data-device.c
index 6a81bc8..87aa902 100644
--- a/src/data-device.c
+++ b/src/data-device.c
@@ -654,7 +654,8 @@ data_device_start_drag(struct wl_client *client, 
struct wl_resource *resource,
          seat->pointer->grab_serial != serial ||
          !seat->pointer->focus ||
          seat->pointer->focus->surface != 
wl_resource_get_user_data(origin_resource)) &&
-        (seat->touch->grab_serial != serial ||
+        (!seat->touch ||
+            seat->touch->grab_serial != serial ||
          !seat->touch->focus ||
          seat->touch->focus->surface != 
wl_resource_get_user_data(origin_resource)))
          return;
-- 
1.8.3.2



More information about the wayland-devel mailing list