From 703ef5b7b68aafd527d319901e3f41f1b9f85d55 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 17 Feb 2012 21:49:53 +0000 Subject: (svn r23962) -Fix [FS#5068]: [Script] Infinite recursion within a script wasn't caught properly, so they could cause crashes of OpenTTD instead of the AI --- src/3rdparty/squirrel/squirrel/sqvm.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/3rdparty') diff --git a/src/3rdparty/squirrel/squirrel/sqvm.h b/src/3rdparty/squirrel/squirrel/sqvm.h index 73b5a0451..4b922c370 100644 --- a/src/3rdparty/squirrel/squirrel/sqvm.h +++ b/src/3rdparty/squirrel/squirrel/sqvm.h @@ -200,6 +200,10 @@ inline SQObjectPtr &stack_get(HSQUIRRELVM v,SQInteger idx){return ((idx>=0)?(v-> #define PUSH_CALLINFO(v,nci){ \ if(v->_callsstacksize == v->_alloccallsstacksize) { \ + if (v->_callsstacksize > 65535) {\ + v->Raise_Error(_SC("stack overflow"));\ + return false;\ + }\ v->GrowCallStack(); \ } \ v->ci = &v->_callsstack[v->_callsstacksize]; \ -- cgit v1.2.3-70-g09d2