protos/linux: Add E820 entries bounds check
diff --git a/common/protos/linux_x86.c b/common/protos/linux_x86.c
index c6f544be..f9fba8e5 100644
--- a/common/protos/linux_x86.c
+++ b/common/protos/linux_x86.c
@@ -597,6 +597,9 @@ no_fb:;
if (mmap[i].type >= 0x1000) {
continue;
}
+ if (j >= E820_MAX_ENTRIES_ZEROPAGE) {
+ panic(false, "linux: Too many E820 memory map entries");
+ }
e820_table[j].addr = mmap[i].base;
e820_table[j].size = mmap[i].length;
e820_table[j].type = mmap[i].type;
