From ef09794faabf98e9d3defb54331b9ef591c064a5 Mon Sep 17 00:00:00 2001 From: planetmaker Date: Thu, 25 Aug 2011 16:37:27 +0000 Subject: (svn r22843) -Fix [FS#4748]: Harden savegame load against too many ai config settings (monoid) --- src/saveload/ai_sl.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/saveload') 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); -- cgit v1.2.3-70-g09d2