Don't access out of bounds arguments

QQmlV4Function wasn't checking argc correctly when
accessing the arguments it contains.

Change-Id: I475c1366d46a5ef9c91104c12343507e469a69bb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This commit is contained in:
Lars Knoll 2013-09-12 12:58:39 +02:00 committed by The Qt Project
parent d6837e9ca3
commit 4691396f96
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ class QQmlV4Function
{
public:
int length() const { return argc; }
QV4::Value operator[](int idx) { return args[idx]; }
QV4::Value operator[](int idx) { return idx < argc ? args[idx] : QV4::Value::undefinedValue(); }
QQmlContextData *context() { return ctx; }
QV4::Value qmlGlobal() { return global; }
void setReturnValue(const QV4::Value &rv) { *retVal = rv; }