From 7ba335063f492aa62bcdd8d34a4f3451f5fa3671 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Sun, 13 Sep 2026 08:24:13 +0200 Subject: [PATCH] don't crash when clicking an empty area If l is not initialized, accessing l->layer_surface->current.keyboard_interactive causes a segmentation fault. This was hard to see because c above was never initialized but never caused a crash, and dwl also didn't crash building with ASan. Also initialize c to be safe. Fixes 4c54bd8. Fixes https://codeberg.org/dwl/dwl/issues/1225. --- dwl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dwl.c b/dwl.c index fa8c8ae..8d32c08 100644 --- a/dwl.c +++ b/dwl.c @@ -643,8 +643,8 @@ buttonpress(struct wl_listener *listener, void *data) struct wlr_pointer_button_event *event = data; struct wlr_keyboard *keyboard; uint32_t mods; - Client *c; - LayerSurface *l; + Client *c = NULL; + LayerSurface *l = NULL; const Button *b; wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);