aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4errorobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-10-19 15:14:54 +0200
committerLars Knoll <lars.knoll@qt.io>2017-11-07 07:24:13 +0000
commitb6329aaf18277a25957a8efe8b496960b404bb36 (patch)
treec822b459c6c1046b48298048b79b93b84b09982f /src/qml/jsruntime/qv4errorobject.cpp
parent1c3e1df2536712c7c2aef4ec5f68316a7e32e4ff (diff)
Don't access arguments that are potentially out of bounds
Change-Id: I45259c66f2a4c6c60065852db34182c8cf9c9c02 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4errorobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4errorobject.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4errorobject.cpp b/src/qml/jsruntime/qv4errorobject.cpp
index be2bc0be9b..af420471ea 100644
--- a/src/qml/jsruntime/qv4errorobject.cpp
+++ b/src/qml/jsruntime/qv4errorobject.cpp
@@ -235,7 +235,8 @@ void Heap::ErrorCtor::init(QV4::ExecutionContext *scope, const QString &name)
ReturnedValue ErrorCtor::construct(const Managed *that, CallData *callData)
{
- return ErrorObject::create<ErrorObject>(that->engine(), callData->args[0])->asReturnedValue();
+ Value v = Value::fromReturnedValue(callData->argument(0));
+ return ErrorObject::create<ErrorObject>(that->engine(), v)->asReturnedValue();
}
ReturnedValue ErrorCtor::call(const Managed *that, CallData *callData)