commit 24c093a

wf  ·  2026-05-22 06:39:48 +0000 UTC
parent 097c839
Fix segfault on invalid window
1 files changed,  +2, -1
+2, -1
 1@@ -2,6 +2,7 @@
 2 #include <string.h>
 3 #include <stdlib.h>
 4 #include <inttypes.h>
 5+#include <limits.h>
 6 
 7 #include <wayland-server.h>
 8 #include <swc.h>
 9@@ -13,7 +14,7 @@
10 
11 /* ugly mess but better than nothing */
12 #define ARG_CLIENT(x) \
13-	uint32_t id = wm.cur->id; \
14+	uint32_t id = wm.cur ? wm.cur->id : UINT32_MAX; \
15 	if (x) id = fn_uint(x); \
16 	struct client *tmp, *c = wm.cur; \
17 	wl_list_for_each(tmp, &wm.clients, link) \