3rdParty: add bounds checking to cart_rom.c in mupen64plus-core

This commit is contained in:
Rosalie Wanders
2025-10-19 12:04:05 +02:00
parent aba3676b1e
commit 6ade361df3
@@ -63,9 +63,13 @@ void read_cart_rom(void* opaque, uint32_t address, uint32_t* value)
{
*value = cart_rom->last_write;
}
else if (addr < cart_rom->rom_size)
{
*value = *(uint32_t*)(cart_rom->rom + addr);
}
else
{
*value = cart_rom->rom_size == 0 ? 0 : *(uint32_t*)(cart_rom->rom + addr);
*value = 0;
}
}