NDSSystem:

- When reading the ROM region info, do a proper bounds check to prevent out-of-bounds crashes if the region code is invalid. An invalid region code will now report as "Unknown".
This commit is contained in:
rogerman 2012-07-24 20:12:46 +00:00
parent 167234d171
commit bdb3a756bc
1 changed files with 1 additions and 1 deletions

View File

@ -388,7 +388,7 @@ void GameInfo::populate()
memcpy(ROMserial+4, header.gameCode, 4);
u32 region = (u32)(std::max<s32>(strchr(regions[0],header.gameCode[3]) - regions[0] + 1, 0));
if (region != 0)
if (region > 0 && region < 12)
strcat(ROMserial, regions[region]);
else
strcat(ROMserial, "Unknown");