aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/0020-in-static-dl_iterate_phdr-fix-use-of-possibly-uninit.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2017-03-20 15:25:48 +0200
committerTimo Teräs <timo.teras@iki.fi>2017-03-21 08:15:29 +0200
commit1a4d299a0242a02aa0d4843dd9947d4187e70414 (patch)
tree524965445ca8c9eba7f425db6ffb2035d8025500 /main/musl/0020-in-static-dl_iterate_phdr-fix-use-of-possibly-uninit.patch
parentc12931e8863fa9fddc90390db24a4a591f43043e (diff)
downloadaports-1a4d299a0242a02aa0d4843dd9947d4187e70414.tar.bz2
aports-1a4d299a0242a02aa0d4843dd9947d4187e70414.tar.xz
main/musl: cherry-pick upstream fixes
ldso changes (lazy emulation etc) are not stable yet, so it's are not included. the missing patch numbers are for those commits.
Diffstat (limited to 'main/musl/0020-in-static-dl_iterate_phdr-fix-use-of-possibly-uninit.patch')
-rw-r--r--main/musl/0020-in-static-dl_iterate_phdr-fix-use-of-possibly-uninit.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/main/musl/0020-in-static-dl_iterate_phdr-fix-use-of-possibly-uninit.patch b/main/musl/0020-in-static-dl_iterate_phdr-fix-use-of-possibly-uninit.patch
new file mode 100644
index 0000000000..0dd2d6f8b6
--- /dev/null
+++ b/main/musl/0020-in-static-dl_iterate_phdr-fix-use-of-possibly-uninit.patch
@@ -0,0 +1,28 @@
+From 500f5bee6c03981961f1586fca2a1dee6fdce7c7 Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Tue, 14 Mar 2017 14:29:50 -0400
+Subject: [PATCH] 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.
+---
+ src/ldso/dl_iterate_phdr.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+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];
+--
+2.11.1
+