summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.cpp b/src/3rdparty/squirrel/squirrel/sqvm.cpp
index c2ca7e19c..c3cdeae30 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp
@@ -336,6 +336,10 @@ bool SQVM::StartCall(SQClosure *closure,SQInteger target,SQInteger args,SQIntege
SQInteger ndef = func->_ndefaultparams;
if(ndef && nargs < paramssize) {
SQInteger diff = paramssize - nargs;
+ if (diff > ndef) {
+ Raise_Error(_SC("wrong number of parameters"));
+ return false;
+ }
for(SQInteger n = ndef - diff; n < ndef; n++) {
_stack._vals[stackbase + (nargs++)] = closure->_defaultparams[n];
}