diff mbox series

[1/9] conf: fix use after free in _snd_config_load_with_include

Message ID 20201226213547.175071-2-alexhenrie24@gmail.com (mailing list archive)
State New, archived
Headers show
Series scan-build fixes | expand

Commit Message

Alex Henrie Dec. 26, 2020, 9:35 p.m. UTC
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
 src/conf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Takashi Iwai Dec. 27, 2020, 8:38 a.m. UTC | #1
On Sat, 26 Dec 2020 22:35:39 +0100,
Alex Henrie wrote:
> 
> Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>

Applied, thanks.


Takashi
diff mbox series

Patch

diff --git a/src/conf.c b/src/conf.c
index 7df2b4e7..44d1bfde 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -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;