aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain/uClibc/patches-0.9.31/000-upstream-calloc_return_zeroed_memory.patch
diff options
context:
space:
mode:
authorAlexandros C. Couloumbis <alex@ozo.com>2010-11-18 14:58:37 +0000
committerAlexandros C. Couloumbis <alex@ozo.com>2010-11-18 14:58:37 +0000
commit2c24f3ae2f026b5dba248985f0efc80cadcf43f6 (patch)
tree36f98cb56900b7d8514ec4b0a198abe243dc1f90 /toolchain/uClibc/patches-0.9.31/000-upstream-calloc_return_zeroed_memory.patch
parent123048f3caaa6f0b3b7d49cb018516926f97ed23 (diff)
downloadupstream-2c24f3ae2f026b5dba248985f0efc80cadcf43f6.tar.gz
upstream-2c24f3ae2f026b5dba248985f0efc80cadcf43f6.tar.bz2
upstream-2c24f3ae2f026b5dba248985f0efc80cadcf43f6.zip
toolchain/uClibc: push some upstream patches for uClibc-0.9.31. should resolve isses of #8269
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24029 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'toolchain/uClibc/patches-0.9.31/000-upstream-calloc_return_zeroed_memory.patch')
-rw-r--r--toolchain/uClibc/patches-0.9.31/000-upstream-calloc_return_zeroed_memory.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/toolchain/uClibc/patches-0.9.31/000-upstream-calloc_return_zeroed_memory.patch b/toolchain/uClibc/patches-0.9.31/000-upstream-calloc_return_zeroed_memory.patch
new file mode 100644
index 0000000000..b0715058da
--- /dev/null
+++ b/toolchain/uClibc/patches-0.9.31/000-upstream-calloc_return_zeroed_memory.patch
@@ -0,0 +1,33 @@
+From afd7606ca42a2586b8823c7bd1a4a7cfd2476e3b Mon Sep 17 00:00:00 2001
+From: Steven J. Magnani <steve@digidescorp.com>
+Date: Wed, 09 Jun 2010 14:02:21 +0000
+Subject: malloc-simple: Make calloc() return zeroed memory
+
+The 0.9.31 release included a change to malloc-simple to request
+uninitialized memory from noMMU kernels. Unfortunately, the corresponding
+calloc() code assumed that memory returned by malloc() was already zeroed,
+which leads to all kinds of nastiness.
+
+Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c
+index 51da14a..914c89d 100644
+--- a/libc/stdlib/malloc-simple/alloc.c
++++ b/libc/stdlib/malloc-simple/alloc.c
+@@ -60,11 +60,10 @@ void * calloc(size_t nmemb, size_t lsize)
+ __set_errno(ENOMEM);
+ return NULL;
+ }
+- result=malloc(size);
+-#if 0
+- /* Standard unix mmap using /dev/zero clears memory so calloc
+- * doesn't need to actually zero anything....
+- */
++ result = malloc(size);
++
++#ifndef __ARCH_USE_MMU__
++ /* mmap'd with MAP_UNINITIALIZE, we have to blank memory ourselves */
+ if (result != NULL) {
+ memset(result, 0, size);
+ }