From 3d8286d7c8d9df416288802e5a2d10860cf624d5 Mon Sep 17 00:00:00 2001 From: Bram Stolk Date: Fri, 2 Jan 2026 14:25:37 -0800 Subject: [PATCH] loader: fix UB in wayland helper code. The wayland helper will use uninitialized data, causing undefined behaviour. This was because the feedback data was allocated, but not fully initialized. After the fix, SDL's vulkantest runs cleanly through valgrind. Before, it would not. Signed-off-by: Bram Stolk Reviewed-by: Eric Engestrom Part-of: --- src/loader/loader_wayland_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/loader/loader_wayland_helper.c b/src/loader/loader_wayland_helper.c index 1337eb8753c..d091ecf1739 100644 --- a/src/loader/loader_wayland_helper.c +++ b/src/loader/loader_wayland_helper.c @@ -412,7 +412,8 @@ loader_wayland_presentation_feedback(struct loader_wayland_presentation *pres, !tracing) return; - fd = malloc(sizeof *fd); + fd = calloc(1, sizeof *fd); + fd->presentation = pres; fd->tracing = tracing; if (tracing) {