From 2d43b6b51541052e38889af6edfc53c50ba10985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sun, 5 Jan 2025 21:37:14 +0100 Subject: [PATCH] pipewire-jack: fix property list underallocation `(n_items) + 1 * sizeof(*items)` is not the correct size to allocate for `n_items + 1` count of objects each with size `sizeof(*items)`, the `+ 1` should be inside the parentheses. Fixes #4481 Fixes: 4baa94fce2fc ("thread: make it possible to set a custom create function") --- pipewire-jack/src/pipewire-jack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index 55c49425e..9bc482d78 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -3234,7 +3234,7 @@ static struct spa_thread *impl_create(void *object, if (globals.creator != NULL) { uint32_t i, n_items = props ? props->n_items : 0; - items = alloca((n_items) + 1 * sizeof(*items)); + items = alloca((n_items + 1) * sizeof(*items)); for (i = 0; i < n_items; i++) items[i] = props->items[i];