aboutsummaryrefslogtreecommitdiffstats
path: root/sway/xdg_activation_v1.c
diff options
context:
space:
mode:
authorLibravatar Filip SzczepaƄski <jazz2rulez@gmail.com>2022-09-12 22:53:09 +0100
committerLibravatar Kirill Primak <vyivel@eclair.cafe>2022-09-13 00:59:18 +0300
commit1c368fbb5fcd8fb67040bcc12bd71c7fbf119e97 (patch)
treed0cad93739c03435b3386a106fc6b6baa3b2d380 /sway/xdg_activation_v1.c
parentconfig/output: test adaptive sync (diff)
downloadsway-1c368fbb5fcd8fb67040bcc12bd71c7fbf119e97.tar.gz
sway-1c368fbb5fcd8fb67040bcc12bd71c7fbf119e97.tar.zst
sway-1c368fbb5fcd8fb67040bcc12bd71c7fbf119e97.zip
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.
Diffstat (limited to 'sway/xdg_activation_v1.c')
-rw-r--r--sway/xdg_activation_v1.c3
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,
11 11
12 struct wlr_xdg_surface *xdg_surface = 12 struct wlr_xdg_surface *xdg_surface =
13 wlr_xdg_surface_from_wlr_surface(event->surface); 13 wlr_xdg_surface_from_wlr_surface(event->surface);
14 if (xdg_surface == NULL) {
15 return;
16 }
14 struct sway_view *view = xdg_surface->data; 17 struct sway_view *view = xdg_surface->data;
15 if (!xdg_surface->mapped || view == NULL) { 18 if (!xdg_surface->mapped || view == NULL) {
16 return; 19 return;