From: Jaroslav Kysela Date: Thu, 18 Sep 2025 09:00:47 +0000 (+0200) Subject: conf: fix parse_array_def override code path X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;p=alsa-lib.git conf: fix parse_array_def override code path The error may cause segmentation fault and incorrect behaviour. Closes: https://github.com/alsa-project/alsa-lib/issues/477 Signed-off-by: Jaroslav Kysela --- diff --git a/src/conf.c b/src/conf.c index 905c8f4d..a48e0db0 100644 --- a/src/conf.c +++ b/src/conf.c @@ -1268,13 +1268,13 @@ static int parse_array_def(snd_config_t *parent, input_t *input, int *idx, int s snd_config_t *n = NULL; if (!skip) { - snd_config_t *g; char static_id[12]; while (1) { snprintf(static_id, sizeof(static_id), "%i", *idx); - if (_snd_config_search(parent, static_id, -1, &g) == 0) { + if (_snd_config_search(parent, static_id, -1, &n) == 0) { if (override) { snd_config_delete(n); + n = NULL; } else { /* merge */ (*idx)++;