Browse Source

malloc: fix the range check of the memory block address inside a non-big block

Ioannis Koutras 11 years ago
parent
commit
23d2b771b9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/malloc.c

+ 1 - 1
src/malloc.c

@@ -61,7 +61,7 @@ void * malloc(size_t size) {
             /* Check that a valid pointer has been returned */
             assert(((uintptr_t) raw_block < (uintptr_t) ptr) &&
                     ((uintptr_t) ptr < (uintptr_t) raw_block +
-                     raw_block->size));
+                     raw_block->size + sizeof(raw_block_header_t)));
             break;
         }
     }