From a62df9c9b7cad47e62b293abeddaf3fcdf09d8ae Mon Sep 17 00:00:00 2001 From: Julien Ramseier Date: Wed, 1 Jul 2020 15:12:14 +0200 Subject: vfscanf: fix possible invalid free due to uninitialized variable use vfscanf() may use the variable 'alloc' uninitialized when taking the branch introduced by commit b287cd745c2243f8e5114331763a5a9813b5f6ee. Spotted by clang. --- src/stdio/vfscanf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stdio/vfscanf.c b/src/stdio/vfscanf.c index b5ebc16e..b78a374d 100644 --- a/src/stdio/vfscanf.c +++ b/src/stdio/vfscanf.c @@ -57,7 +57,7 @@ int vfscanf(FILE *restrict f, const char *restrict fmt, va_list ap) { int width; int size; - int alloc; + int alloc = 0; int base; const unsigned char *p; int c, t; -- cgit v1.2.1