From 13522018006c1f19c29de6b2cec21e7fc174f041 Mon Sep 17 00:00:00 2001 From: Starnakin Date: Thu, 28 Nov 2024 15:15:32 +0100 Subject: [PATCH] fix: memory memset right size of frame_table --- src/memory/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/memory/memory.c b/src/memory/memory.c index fef2605..87d739d 100644 --- a/src/memory/memory.c +++ b/src/memory/memory.c @@ -113,13 +113,13 @@ static void add_frame_node(multiboot_memory_map_t *mmmt) nb_frame = ((size * 8) / (PAGE_SIZE * 8 + 1)) */ const uint32_t nb_frame = ((len * 8) / (PAGE_SIZE * 8 + 1)); - current->first_free_frame = 0; current->next = NULL; current->remaining_frames = nb_frame; current->total_frames = nb_frame; - memset(current->frame_table, 0, nb_frame * 4); + memset(current->frame_table, 0, + nb_frame * sizeof(*current->frame_table)); uint32_t i = 1; for (; i < CEIL(nb_frame, PAGE_SIZE); i++)