~ruther/dwl

7ba335063f492aa62bcdd8d34a4f3451f5fa3671 — Guido Cella 2 months ago fb4102b
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.
1 files changed, 2 insertions(+), 2 deletions(-)

M dwl.c
M dwl.c => dwl.c +2 -2
@@ 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);