:: commit 9fe1386b2c60694f52a46649b9343b25642c1a32

Mintsuki <mintsuki@protonmail.com> — 2026-02-07 16:07

parents: e3b8f542a2

protos/linux_x86: Fix initrd_addr_max overflow when computing module base

diff --git a/common/protos/linux_x86.c b/common/protos/linux_x86.c
index aead25e5..fba8e984 100644
--- a/common/protos/linux_x86.c
+++ b/common/protos/linux_x86.c
@@ -449,7 +449,7 @@ noreturn void linux_load(char *config, char *cmdline) {
     if (setup_header->version <= 0x202 || setup_header->initrd_addr_max == 0) {
         modules_mem_base = 0x38000000;
     } else {
-        modules_mem_base = setup_header->initrd_addr_max + 1;
+        modules_mem_base = (uintptr_t)setup_header->initrd_addr_max + 1;
     }
 
     if (size_of_all_modules > modules_mem_base) {
tab: 248 wrap: offon