about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-05-19 04:42:52 +0000
committerUlrich Drepper <drepper@redhat.com>2007-05-19 04:42:52 +0000
commit2acd01acb10d0c0113f87bf7e787e0854498269d (patch)
tree935dc63000c1792166db21151a8197639659f085
parent129abdd3ee8f6388dbf8d786fd243d0560458905 (diff)
downloadglibc-2acd01acb10d0c0113f87bf7e787e0854498269d.tar.gz
glibc-2acd01acb10d0c0113f87bf7e787e0854498269d.tar.xz
glibc-2acd01acb10d0c0113f87bf7e787e0854498269d.zip
* malloc/malloc.c (do_check_chunk): Correct check for mmaped block
	not overlapping with arena.
-rw-r--r--ChangeLog3
-rw-r--r--malloc/malloc.c2
-rw-r--r--malloc/mcheck.c2
3 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d5e1de39cd..5413c12889 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-05-18  Ulrich Drepper  <drepper@redhat.com>
 
+	* malloc/malloc.c (do_check_chunk): Correct check for mmaped block
+	not overlapping with arena.
+
 	* malloc/mcheck.c (reallochook): If size==0, free the block.
 
 	* rt/tst-shm.c: Use fstat64 instead of fstat.
diff --git a/malloc/malloc.c b/malloc/malloc.c
index e061db94d6..d37d920cd1 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2572,7 +2572,7 @@ static void do_check_chunk(av, p) mstate av; mchunkptr p;
 #if HAVE_MMAP
     /* address is outside main heap  */
     if (contiguous(av) && av->top != initial_top(av)) {
-      assert(((char*)p) < min_address || ((char*)p) > max_address);
+      assert(((char*)p) < min_address || ((char*)p) >= max_address);
     }
     /* chunk is page-aligned */
     assert(((p->prev_size + sz) & (mp_.pagesize-1)) == 0);
diff --git a/malloc/mcheck.c b/malloc/mcheck.c
index 4e0d4b5b7d..524acc755c 100644
--- a/malloc/mcheck.c
+++ b/malloc/mcheck.c
@@ -267,7 +267,7 @@ reallochook (__ptr_t ptr, __malloc_size_t size, const __ptr_t caller)
   if (size == 0)
     {
       freehook (ptr, caller);
-      return;
+      return NULL;
     }
 
   struct hdr *hdr;