about summary refs log tree commit diff
path: root/src/ldso/dl_iterate_phdr.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2017-03-14 14:29:50 -0400
committerRich Felker <dalias@aerifal.cx>2017-03-14 14:29:50 -0400
commit500f5bee6c03981961f1586fca2a1dee6fdce7c7 (patch)
treef6ce3242f48a80d403739485516617cd61391626 /src/ldso/dl_iterate_phdr.c
parent6582baa752a8facb2c8a7b5b3dcf67331429cdc1 (diff)
downloadmusl-500f5bee6c03981961f1586fca2a1dee6fdce7c7.tar.gz
musl-500f5bee6c03981961f1586fca2a1dee6fdce7c7.tar.xz
musl-500f5bee6c03981961f1586fca2a1dee6fdce7c7.zip
in static dl_iterate_phdr, fix use of possibly-uninitialized aux data
this could only happen if an incomplete auxv was passed into the
program, but it's better to just initialize the data anyway.
Diffstat (limited to 'src/ldso/dl_iterate_phdr.c')
-rw-r--r--src/ldso/dl_iterate_phdr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ldso/dl_iterate_phdr.c b/src/ldso/dl_iterate_phdr.c
index c141fd9b..e55cbf76 100644
--- a/src/ldso/dl_iterate_phdr.c
+++ b/src/ldso/dl_iterate_phdr.c
@@ -11,7 +11,7 @@ static int static_dl_iterate_phdr(int(*callback)(struct dl_phdr_info *info, size
 	size_t base = 0;
 	size_t n;
 	struct dl_phdr_info info;
-	size_t i, aux[AUX_CNT];
+	size_t i, aux[AUX_CNT] = {0};
 
 	for (i=0; libc.auxv[i]; i+=2)
 		if (libc.auxv[i]<AUX_CNT) aux[libc.auxv[i]] = libc.auxv[i+1];