diff options
author | rubidium <rubidium@openttd.org> | 2012-02-17 21:49:53 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2012-02-17 21:49:53 +0000 |
commit | 703ef5b7b68aafd527d319901e3f41f1b9f85d55 (patch) | |
tree | 292b9996f336ad9cd912bddc101ea8a38b243d14 /src | |
parent | 0ba47deca161456f2145b30deca013c0e82fd011 (diff) | |
download | openttd-703ef5b7b68aafd527d319901e3f41f1b9f85d55.tar.xz |
(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
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/squirrel/squirrel/sqvm.h | 4 |
1 files changed, 4 insertions, 0 deletions
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]; \ |