about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-10-31 15:35:24 -0400
committerRich Felker <dalias@aerifal.cx>2015-03-30 01:41:32 -0400
commite48fff8d338d85616dc650cc8b4dd5ae00083da1 (patch)
treee1aeb54c33784203d1a1fbb54bb4b05f6d7e379e
parent4ab6544a418ad56d42c2eb05940918a948075a3f (diff)
downloadmusl-e48fff8d338d85616dc650cc8b4dd5ae00083da1.tar.gz
musl-e48fff8d338d85616dc650cc8b4dd5ae00083da1.tar.xz
musl-e48fff8d338d85616dc650cc8b4dd5ae00083da1.zip
fix uninitialized mode variable in openat function
this was introduced in commit 2da3ab1382ca8e39eb1e4428103764a81fba73d3
as an oversight while making the variadic argument access conditional.

(cherry picked from commit e146e6035fecea080fb17450db3c8bb44d36e07d)
-rw-r--r--src/fcntl/openat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fcntl/openat.c b/src/fcntl/openat.c
index 4faeb296..e741336c 100644
--- a/src/fcntl/openat.c
+++ b/src/fcntl/openat.c
@@ -5,7 +5,7 @@
 
 int openat(int fd, const char *filename, int flags, ...)
 {
-	mode_t mode;
+	mode_t mode = 0;
 
 	if ((flags & O_CREAT) || (flags & O_TMPFILE) == O_TMPFILE) {
 		va_list ap;