From 5db8dd7361a3f650a14fef4579e078f85490621e Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 12 Jan 2015 14:19:35 +0100 Subject: [PATCH] Verify array bounds fixes #7812 --- lib/config/vmops.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/config/vmops.hpp b/lib/config/vmops.hpp index f89f7c1e5..91663a1c5 100644 --- a/lib/config/vmops.hpp +++ b/lib/config/vmops.hpp @@ -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); }