diff --git a/common/protos/multiboot1.c b/common/protos/multiboot1.c index 43017b1e..e5e18b1b 100644 --- a/common/protos/multiboot1.c +++ b/common/protos/multiboot1.c @@ -155,7 +155,7 @@ bool multiboot1_load(char *config, char *cmdline) { memcpy(sections, kernel + section_hdr_info->section_offset, section_hdr_info->section_entry_size * section_hdr_info->num); for (size_t i = 0; i < section_hdr_info->num; i++) { - struct elf64_shdr *shdr = (void *)sections + section_hdr_info->section_offset + i * section_hdr_info->section_entry_size; + struct elf64_shdr *shdr = (void *)sections + i * section_hdr_info->section_entry_size; if (shdr->sh_addr != 0 || shdr->sh_size == 0) { continue; diff --git a/common/protos/multiboot2.c b/common/protos/multiboot2.c index 0e37b32a..f7dff84e 100644 --- a/common/protos/multiboot2.c +++ b/common/protos/multiboot2.c @@ -318,7 +318,7 @@ bool multiboot2_load(char *config, char* cmdline) { memcpy(tag->sections, kernel + section_hdr_info->section_offset, section_hdr_info->section_entry_size * section_hdr_info->num); for (size_t i = 0; i < section_hdr_info->num; i++) { - struct elf64_shdr *shdr = (void *)tag->sections + section_hdr_info->section_offset + i * section_hdr_info->section_entry_size; + struct elf64_shdr *shdr = (void *)tag->sections + i * section_hdr_info->section_entry_size; if (shdr->sh_addr != 0 || shdr->sh_size == 0) { continue;