diff options
author | Timo Teräs <timo.teras@iki.fi> | 2017-07-05 13:04:48 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2017-07-05 13:06:40 +0300 |
commit | 50c197239c89545dd072af45f8e644c92fb706a5 (patch) | |
tree | 269117c2bc4f3577f66718accc9d70c66b52bd06 /main/musl/0056-fix-undefined-behavior-in-free.patch | |
parent | a0e0ebc0d01600ae0a82f6a1a788324d1b5e09c5 (diff) | |
download | aports-50c197239c89545dd072af45f8e644c92fb706a5.tar.bz2 aports-50c197239c89545dd072af45f8e644c92fb706a5.tar.xz |
main/musl: cherry-pick upstream fixes
including regression fix for promoting RTLD_LOCAL to RTLD_GLOBAL
Diffstat (limited to 'main/musl/0056-fix-undefined-behavior-in-free.patch')
-rw-r--r-- | main/musl/0056-fix-undefined-behavior-in-free.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/main/musl/0056-fix-undefined-behavior-in-free.patch b/main/musl/0056-fix-undefined-behavior-in-free.patch new file mode 100644 index 0000000000..cccf2db4c0 --- /dev/null +++ b/main/musl/0056-fix-undefined-behavior-in-free.patch @@ -0,0 +1,34 @@ +From 60ab365cae24063b0f21821860ca16fb63e81f81 Mon Sep 17 00:00:00 2001 +From: Alexander Monakov <amonakov@ispras.ru> +Date: Tue, 27 Jun 2017 20:58:47 +0300 +Subject: [PATCH 56/56] fix undefined behavior in free + +--- + src/malloc/malloc.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c +index d5ee4280..9e05e1d6 100644 +--- a/src/malloc/malloc.c ++++ b/src/malloc/malloc.c +@@ -450,14 +450,15 @@ copy_realloc: + + void free(void *p) + { +- struct chunk *self = MEM_TO_CHUNK(p); +- struct chunk *next; ++ struct chunk *self, *next; + size_t final_size, new_size, size; + int reclaim=0; + int i; + + if (!p) return; + ++ self = MEM_TO_CHUNK(p); ++ + if (IS_MMAPPED(self)) { + size_t extra = self->psize; + char *base = (char *)self - extra; +-- +2.13.1 + |