]> git.alsa-project.org Git - alsa-lib.git/commitdiff
conf: fix use after free in _snd_config_load_with_include
authorAlex Henrie <alexhenrie24@gmail.com>
Sat, 26 Dec 2020 21:35:39 +0000 (14:35 -0700)
committerTakashi Iwai <tiwai@suse.de>
Sun, 27 Dec 2020 08:20:38 +0000 (09:20 +0100)
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/conf.c

index 7df2b4e77759309bbe932ccf6977b83be715f673..44d1bfde66ad3f9d45f513aca61c956caf8582c0 100644 (file)
@@ -1970,7 +1970,9 @@ int _snd_config_load_with_include(snd_config_t *config, snd_input_t *in,
                SNDERR("%s:%d:%d:%s", fd->name ? fd->name : "_toplevel_", fd->line, fd->column, str);
                goto _end;
        }
-       if (get_char(&input) != LOCAL_UNEXPECTED_EOF) {
+       err = get_char(&input);
+       fd = input.current;
+       if (err != LOCAL_UNEXPECTED_EOF) {
                SNDERR("%s:%d:%d:Unexpected }", fd->name ? fd->name : "", fd->line, fd->column);
                err = -EINVAL;
                goto _end;