Explorar o código

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

Ioannis Koutras %!s(int64=11) %!d(string=hai) anos
pai
achega
23d2b771b9
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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;
         }
     }