loader: fix UB in wayland helper code.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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 <b.stolk@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39133>
This commit is contained in:
Bram Stolk 2026-01-02 14:25:37 -08:00 committed by Marge Bot
parent c05d276473
commit 3d8286d7c8

View file

@ -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) {