about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJulien Ramseier <j.ramseier@gmail.com>2020-07-01 15:12:14 +0200
committerRich Felker <dalias@aerifal.cx>2020-07-02 11:25:44 -0400
commita62df9c9b7cad47e62b293abeddaf3fcdf09d8ae (patch)
tree7999339146627a102cc74b63f75bff3e510facad /src
parentea6d7847ac128f02d1f01ffd01e68341df34ac6e (diff)
downloadmusl-a62df9c9b7cad47e62b293abeddaf3fcdf09d8ae.tar.gz
musl-a62df9c9b7cad47e62b293abeddaf3fcdf09d8ae.tar.xz
musl-a62df9c9b7cad47e62b293abeddaf3fcdf09d8ae.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/stdio/vfscanf.c2
1 files changed, 1 insertions, 1 deletions
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;