From d62b1d540781c61403681c1d903b7c74af6d1fa9 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 18 Sep 2025 11:00:47 +0200 Subject: [PATCH] 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 --- src/conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)++; -- 2.47.3