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:
parent
d6837e9ca3
commit
4691396f96
|
@ -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; }
|
||||
|
|
Loading…
Reference in New Issue