Fix #8: Potential read of unitialized memory in town growth tiles

This commit is contained in:
dP
2021-04-19 00:13:23 +03:00
parent 07b537b611
commit f6f5c001cc

View File

@@ -33,7 +33,7 @@ public:
auto a = this->towns_growth_tiles.find(tile);
auto b = this->towns_growth_tiles_last_month.find(tile);
auto as = (a == this->towns_growth_tiles.end() ? TownGrowthTileState::NONE : (*a).second);
auto bs = (b == this->towns_growth_tiles.end() ? TownGrowthTileState::NONE : (*b).second);
auto bs = (b == this->towns_growth_tiles_last_month.end() ? TownGrowthTileState::NONE : (*b).second);
return std::max(as, bs);
}
};