mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-05-31 21:38:37 -04:00
pcm: snd_pcm_slave_conf - fix C99 variable-length array allocation
The C standard (C99 §6.7.5.2p1) requires VLA bounds to be greater than zero; a bound of 0 is undefined behavior. Reported by UBSan. Fixes: https://github.com/alsa-project/alsa-lib/issues/505 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
6f074eefb1
commit
33c9949e75
1 changed files with 1 additions and 1 deletions
|
|
@ -7824,7 +7824,7 @@ int snd_pcm_slave_conf(snd_config_t *root, snd_config_t *conf,
|
||||||
int flags;
|
int flags;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
int present;
|
int present;
|
||||||
} fields[count];
|
} fields[count > 0 ? count : 1];
|
||||||
unsigned int k;
|
unsigned int k;
|
||||||
snd_config_t *pcm_conf = NULL;
|
snd_config_t *pcm_conf = NULL;
|
||||||
int err;
|
int err;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue