Skip to content

Reject undersized GBA ROM images - #2713

Open
acts-1631 wants to merge 1 commit into
melonDS-emu:masterfrom
acts-1631:fix/gba-rom-minimum-length
Open

Reject undersized GBA ROM images#2713
acts-1631 wants to merge 1 commit into
melonDS-emu:masterfrom
acts-1631:fix/gba-rom-minimum-length

Conversation

@acts-1631

Copy link
Copy Markdown

GBACart::ParseROM accepts any non-empty image, then immediately reads the
game-code field at offset 0xAC to detect solar-sensor titles. Images shorter
than the GBA header therefore reach a read beyond the allocated ROM buffer.

Require the input to contain a complete GBA header before padding or inspecting
header fields. This keeps malformed and truncated images out of the parser.

GBA ROM parsing read the game-code field at offset 0xAC before
checking that the supplied image contained a complete GBA header.
A crafted short ROM therefore caused an out-of-bounds host-memory read.

Require a complete GBA header before parsing the image.
@acts-1631
acts-1631 force-pushed the fix/gba-rom-minimum-length branch from 30c4e33 to 7e10aa9 Compare July 29, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant