summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2011-08-25 16:37:27 +0000
committerplanetmaker <planetmaker@openttd.org>2011-08-25 16:37:27 +0000
commitef09794faabf98e9d3defb54331b9ef591c064a5 (patch)
tree69592acb3f4c78081803cf41759d5747aca823db /src
parentd839aa04755094827f1aa978707daeb25f8f02dc (diff)
downloadopenttd-ef09794faabf98e9d3defb54331b9ef591c064a5.tar.xz
(svn r22843) -Fix [FS#4748]: Harden savegame load against too many ai config settings (monoid)
Diffstat (limited to 'src')
-rw-r--r--src/saveload/ai_sl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/saveload/ai_sl.cpp b/src/saveload/ai_sl.cpp
index fedd3699a..c3a95f89b 100644
--- a/src/saveload/ai_sl.cpp
+++ b/src/saveload/ai_sl.cpp
@@ -66,6 +66,8 @@ static void Load_AIPL()
CompanyID index;
while ((index = (CompanyID)SlIterateArray()) != (CompanyID)-1) {
+ if (index >= MAX_COMPANIES) SlErrorCorrupt("Too many AI configs");
+
_ai_saveload_version = -1;
SlObject(NULL, _ai_company);