Update gbCheats.cpp

Bounds checking is important.
This commit is contained in:
Christopher Snowhill 2016-11-02 21:28:58 -07:00 committed by GitHub
parent 87630fdf84
commit 36d84cfa2b
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ void gbCheatsReadGame(gzFile gzFile, int version)
} else {
gbCheatNumber = utilReadInt(gzFile);
if (gbCheatNumber > 0) {
if (gbCheatNumber > 0 && gbCheatNumber <= MAX_CHEATS) {
utilGzRead(gzFile, &gbCheatList[0], sizeof(gbCheat) * gbCheatNumber);
}
}