weston/desktop-shell
Sergey Bugaev 14ef201295 desktop-shell: don't crash if a surface disappears while grabbed
A surface can get destroyed while a shell grab is active, which can
for example happen if the command running in weston-terminal exits.

When a surface gets destroyed, grab->shsurf is reset to NULL by
destroy_shell_grab_shsurf(), but otherwise the grab remains active and
its callbacks continue to be called. Thus, dereferencing grab->shsurf
in a callback without checking it for NULL first can lead to undefined
behavior, including crashes.

Several functions were already properly checking grab->shsurf for NULL,
move_grab_motion() being one example. Others, however, were not, which
is what this commit fixes.

Related to https://gitlab.freedesktop.org/wayland/weston/issues/192

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2019-02-16 09:45:52 +00:00
..
exposay.c libweston: Use struct timespec for key events 2017-11-27 11:42:07 +02:00
input-panel.c libweston: make wl_output point to weston_head 2018-04-10 14:33:59 +03:00
meson.build Add Meson build system 2018-12-09 14:50:54 +02:00
shell.c desktop-shell: don't crash if a surface disappears while grabbed 2019-02-16 09:45:52 +00:00
shell.h libweston: Use struct timespec for compositor time 2017-11-27 11:42:07 +02:00