mirror of
https://github.com/swaywm/sway.git
synced 2024-12-29 00:16:22 +01:00
Fix crash in xdg_activation_v1.c
wlr_xdg_surface_from_wlr_surface() can return a NULL pointer, so check for NULL before dereferencing it.
This commit is contained in:
parent
07bfeb2abc
commit
1c368fbb5f
1 changed files with 3 additions and 0 deletions
|
@ -11,6 +11,9 @@ void xdg_activation_v1_handle_request_activate(struct wl_listener *listener,
|
||||||
|
|
||||||
struct wlr_xdg_surface *xdg_surface =
|
struct wlr_xdg_surface *xdg_surface =
|
||||||
wlr_xdg_surface_from_wlr_surface(event->surface);
|
wlr_xdg_surface_from_wlr_surface(event->surface);
|
||||||
|
if (xdg_surface == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
struct sway_view *view = xdg_surface->data;
|
struct sway_view *view = xdg_surface->data;
|
||||||
if (!xdg_surface->mapped || view == NULL) {
|
if (!xdg_surface->mapped || view == NULL) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue