From b7d62067ccedc7beceb78fd46795e259001db550 Mon Sep 17 00:00:00 2001 From: Mark Clark Date: Sat, 17 Feb 2018 17:15:10 -0500 Subject: [PATCH] Fixed issue where special could attempt accessing index outside range for specials; --- src/game/boe.town.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/boe.town.cpp b/src/game/boe.town.cpp index 531c3f1f..e7caceee 100644 --- a/src/game/boe.town.cpp +++ b/src/game/boe.town.cpp @@ -1282,7 +1282,8 @@ void erase_hidden_towns(cOutdoors& sector, int quadrant_x, int quadrant_y) void erase_completed_specials(cOutdoors& sector) { for (auto tile_index = 0; tile_index < sector.special_locs.size(); tile_index++) { - if (sector.special_locs[tile_index].spec < 0) + if (sector.special_locs[tile_index].spec < 0 || + sector.special_locs[tile_index].spec >= sector.specials.size()) continue; auto sn = sector.specials[sector.special_locs[tile_index].spec];