From 1aaf8cd044d310fe7058601b703fa98ce6165c3a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sat, 1 Jun 2013 21:47:43 +0200 Subject: [PATCH] Fix uninitialized memory read in tst_qqmlecmascript::include auto-test 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 --- src/qml/qml/v4/qv4include.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qml/qml/v4/qv4include.cpp b/src/qml/qml/v4/qv4include.cpp index d4c2c13..b834937 100644 --- a/src/qml/qml/v4/qv4include.cpp +++ b/src/qml/qml/v4/qv4include.cpp @@ -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]; -- 2.7.4