Skip to content

Commit

Permalink
Merge pull request #58 from dbtick/dev
Browse files Browse the repository at this point in the history
Corrected read OOB range checking.
  • Loading branch information
mrcook authored Jul 30, 2022
2 parents 2a2a6b7 + 71dad41 commit 8d8d1c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/game_save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ bool loadGame(bool &generate) {
count = rdByte();
char_tmp = rdByte();
for (int i = count; i > 0; i--) {
if (tile >= &dg.floor[MAX_HEIGHT][0]) {
if (tile > &dg.floor[MAX_HEIGHT-1][MAX_WIDTH-1]) {
goto error;
}
tile->feature_id = (uint8_t)(char_tmp & 0xF);
Expand Down

0 comments on commit 8d8d1c7

Please sign in to comment.