Fix an out of bounds read.
authorLars Knoll <lars.knoll@digia.com>
Mon, 14 Jan 2013 13:55:35 +0000 (14:55 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Mon, 14 Jan 2013 15:33:47 +0000 (16:33 +0100)
Change-Id: Ie7eb4cdc9c0f5002b67145f23fe8a0a3b105b626
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
qv4array.cpp

index 2316491..ab6a18e 100644 (file)
@@ -526,8 +526,8 @@ Value Array::indexOf(Value v, uint fromIndex, uint endIndex, ExecutionContext *c
                 return Value::fromDouble(n->key());
         }
     } else {
-        if (endIndex > len)
-            endIndex = len;
+        if (endIndex > values.size())
+            endIndex = values.size();
         PropertyDescriptor *pd = values.data() + offset;
         PropertyDescriptor *end = pd + endIndex;
         pd += fromIndex;