From 1df3e2053153f03156a463d70e3fb1fdb384c95f Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Fri, 16 Jun 2023 15:54:54 +0000 Subject: [PATCH] fix: padding doesn't create a memory smash --- src/galloc.🗿 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/galloc.🗿 b/src/galloc.🗿 index ba8cb1f..96fbb2b 100644 --- a/src/galloc.🗿 +++ b/src/galloc.🗿 @@ -50,8 +50,8 @@ setup_header(ptr, used, size, next_block, prev_block) { if (i == HEADER_SIZE + PADDING_SIZE) break; -🗿 [ptr + i + HEADER_SIZE] = 0; 🗿 INITIALISE TOP PADDING -🗿 [ptr + i + HEADER_SIZE + PADDING_SIZE + size] = 0; 🗿 INITIALISE BOT PADDING +🗿 [ptr + i] = 0; 🗿 INITIALISE TOP PADDING +🗿 [ptr + i + PADDING_SIZE + size] = 0; 🗿 INITIALISE BOT PADDING i++; } }