Fix uninitialized memory read in tst_qqmlecmascript::include auto-test
authorSimon Hausmann <simon.hausmann@digia.com>
Sat, 1 Jun 2013 19:47:43 +0000 (21:47 +0200)
committerLars Knoll <lars.knoll@digia.com>
Sun, 2 Jun 2013 13:14:02 +0000 (15:14 +0200)
Make sure to initialize the callback variable, in the unlikely (but possible)
event of it not getting initialized otherwise.

Change-Id: Ic8bbf90b825157e55bb93dd9e600ff22ca11b911
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/v4/qv4include.cpp

index d4c2c13..b834937 100644 (file)
@@ -180,7 +180,7 @@ QV4::Value QV4Include::include(QV4::SimpleCallContext *ctx)
 
     QUrl url(ctx->engine->resolvedUrl(ctx->arguments[0].toQString()));
 
-    QV4::Value callbackFunction;
+    QV4::Value callbackFunction = QV4::Value::undefinedValue();
     if (ctx->argumentCount >= 2 && ctx->arguments[1].asFunctionObject())
         callbackFunction = ctx->arguments[1];