diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-12 12:58:39 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:13:26 +0200 |
commit | 4691396f96cf8468a9ee4fbb339cc94e339928a7 (patch) | |
tree | 6989786dfb335f44a880c3ec90ed5d41ddc36612 /src/qml/qml/v8/qv8engine_p.h | |
parent | d6837e9ca301e7b6c792e3d24db14fb7bab2db60 (diff) |
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>
Diffstat (limited to 'src/qml/qml/v8/qv8engine_p.h')
-rw-r--r-- | src/qml/qml/v8/qv8engine_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/v8/qv8engine_p.h b/src/qml/qml/v8/qv8engine_p.h index 8f724fa2eb..1296973394 100644 --- a/src/qml/qml/v8/qv8engine_p.h +++ b/src/qml/qml/v8/qv8engine_p.h @@ -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; } |