mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
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 <perex@perex.cz>
This commit is contained in:
parent
3a97718124
commit
d62b1d5407
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
snd_config_t *n = NULL;
|
||||||
|
|
||||||
if (!skip) {
|
if (!skip) {
|
||||||
snd_config_t *g;
|
|
||||||
char static_id[12];
|
char static_id[12];
|
||||||
while (1) {
|
while (1) {
|
||||||
snprintf(static_id, sizeof(static_id), "%i", *idx);
|
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) {
|
if (override) {
|
||||||
snd_config_delete(n);
|
snd_config_delete(n);
|
||||||
|
n = NULL;
|
||||||
} else {
|
} else {
|
||||||
/* merge */
|
/* merge */
|
||||||
(*idx)++;
|
(*idx)++;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue