diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2022-09-12 22:53:09 +0100 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2022-09-12 22:53:09 +0100 |
| commit | 6d1c63b0d1d6c099a608de1a476278d7bd06b1a3 (patch) | |
| tree | d0cad93739c03435b3386a106fc6b6baa3b2d380 | |
| parent | ca2df6055fbcf3a852b80acef0ea64c52aca4f84 (diff) | |
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.
| -rw-r--r-- | sway/xdg_activation_v1.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/xdg_activation_v1.c b/sway/xdg_activation_v1.c index 6c70c785..99e7f9b5 100644 --- a/sway/xdg_activation_v1.c +++ b/sway/xdg_activation_v1.c @@ -11,6 +11,9 @@ void xdg_activation_v1_handle_request_activate(struct wl_listener *listener, struct wlr_xdg_surface *xdg_surface = wlr_xdg_surface_from_wlr_surface(event->surface); + if (xdg_surface == NULL) { + return; + } struct sway_view *view = xdg_surface->data; if (!xdg_surface->mapped || view == NULL) { return; |
