* malloc/malloc.c (do_check_chunk): Correct check for mmaped block
authorUlrich Drepper <drepper@redhat.com>
Sat, 19 May 2007 04:42:52 +0000 (04:42 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 19 May 2007 04:42:52 +0000 (04:42 +0000)
not overlapping with arena.

ChangeLog
malloc/malloc.c
malloc/mcheck.c

index d5e1de3..5413c12 100644 (file)
--- 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.
index e061db9..d37d920 100644 (file)
@@ -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);
index 4e0d4b5..524acc7 100644 (file)
@@ -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;