spa: add spa_alloca that does overflow and limit checks

Make a function like alloca but with overflow checks and a max
allocation size.

Use this function where we can and also make sure that all alloca calls
are in some way limited.
This commit is contained in:
Wim Taymans 2026-04-27 10:53:44 +02:00
parent a9f1ad414e
commit ed2c0ad4ee
10 changed files with 84 additions and 51 deletions

View file

@ -34,6 +34,9 @@
#define MAXLENGTH (4u*1024*1024) /* 4MB */
/* pulseaudio has a 128 char limit for this but we can allow more */
#define MAX_NAME 1024u
#define SCACHE_ENTRY_SIZE_MAX (1024*1024*16)
#define MODULE_INDEX_MASK 0xfffffffu