(svn r22874) -Fix [FS#4747]: Check size of various buffers before allocation. (monoid)

This commit is contained in:
michi_cc
2011-09-02 20:16:41 +00:00
parent 4b6c2259ed
commit 7c325fcb78
5 changed files with 15 additions and 5 deletions

View File

@@ -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);