[PATCH weston] window: fix NULL pointer dereference
Mariusz Ceier
mceier+wayland at gmail.com
Mon Jul 15 17:25:00 PDT 2013
NULL pointer dereference happens when input->focus_widget == NULL
and input->grab == NULL.
Signed-off-by: Mariusz Ceier <mceier+wayland at gmail.com>
---
clients/window.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/clients/window.c b/clients/window.c
index cbfe12f..9933cb9 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -2819,14 +2819,17 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer,
widget = input->grab;
else
widget = input->focus_widget;
- if (widget && widget->motion_handler)
- cursor = widget->motion_handler(input->focus_widget,
- input, time, sx, sy,
- widget->user_data);
- else
- cursor = input->focus_widget->default_cursor;
+ if (widget)
+ {
+ if (widget->motion_handler)
+ cursor = widget->motion_handler(input->focus_widget,
+ input, time, sx, sy,
+ widget->user_data);
+ else
+ cursor = widget->default_cursor;
+ input_set_pointer_image(input, cursor);
+ }
- input_set_pointer_image(input, cursor);
}
static void
--
1.8.3.2
More information about the wayland-devel
mailing list