Verify array bounds

fixes #7812
This commit is contained in:
Gunnar Beutner 2015-01-12 14:19:35 +01:00
parent 9080ca2867
commit 5db8dd7361

View File

@ -235,6 +235,9 @@ public:
return GetPrototypeField(context, field, true, debugInfo);
}
if (index < 0 || index >= arr->GetLength())
BOOST_THROW_EXCEPTION(ScriptError("Array index '" + Convert::ToString(index) + "' is out of bounds.", debugInfo));
return arr->Get(index);
}