summaryrefslogtreecommitdiff
path: root/src/script/squirrel_helper.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/squirrel_helper.hpp')
-rw-r--r--src/script/squirrel_helper.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp
index a7d0bf7ba..babdf74b3 100644
--- a/src/script/squirrel_helper.hpp
+++ b/src/script/squirrel_helper.hpp
@@ -118,6 +118,9 @@ namespace SQConvert {
template <> inline Array *GetParam(ForceType<Array *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr)
{
+ /* Sanity check of the size. */
+ if (sq_getsize(vm, index) > UINT16_MAX) throw sq_throwerror(vm, _SC("an array used as parameter to a function is too large"));
+
SQObject obj;
sq_getstackobj(vm, index, &obj);
sq_pushobject(vm, obj);