From 9f19ecf7b6a2ded8e282742359f397c09534fbbc Mon Sep 17 00:00:00 2001 From: Vasilito Date: Wed, 6 May 2026 13:44:57 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20libwayland=20null=20guards=20made=20dura?= =?UTF-8?q?ble=20=E2=80=94=20appended=20to=20redox.patch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three null-safety additions to wayland-client.c, now in the recipe's redox.patch so they survive source rebuilds: - wl_proxy_add_listener: return -1 on NULL (prevents null+8 page fault) - wl_proxy_get_version: return 0 on NULL - wl_proxy_get_display: return NULL on NULL --- local/patches/libwayland/redox.patch | 29 +++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/local/patches/libwayland/redox.patch b/local/patches/libwayland/redox.patch index 68a5b3e08..7eb575bb7 100644 --- a/local/patches/libwayland/redox.patch +++ b/local/patches/libwayland/redox.patch @@ -36,4 +36,31 @@ +} #include #include - ++--- a/src/wayland-client.c +++++ b/src/wayland-client.c ++@@ -649,6 +649,11 @@ ++ wl_proxy_add_listener(struct wl_proxy *proxy, ++ void (**implementation)(void), void *data) ++ { +++ if (!proxy) { +++ fprintf(stderr, "FATAL: wl_proxy_add_listener(NULL) caller=%p -- returning error\n", +++ __builtin_return_address(0)); +++ return -1; +++ } ++ if (proxy->flags & WL_PROXY_FLAG_WRAPPER) ++ wl_abort("Proxy %p is a wrapper\n", proxy); ++ ++@@ -2448,6 +2453,7 @@ ++ wl_proxy_get_version(struct wl_proxy *proxy) ++ { +++ if (!proxy) return 0; ++ return proxy->version; ++ } ++ ++@@ -2566,6 +2572,7 @@ ++ wl_proxy_get_display(struct wl_proxy *proxy) ++ { +++ if (!proxy) return NULL; ++ return proxy->display; ++ } +