From: Simon Hausmann Date: Sat, 1 Jun 2013 19:47:43 +0000 (+0200) Subject: Fix uninitialized memory read in tst_qqmlecmascript::include auto-test X-Git-Tag: upstream/5.2.1~669^2~353 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1aaf8cd044d310fe7058601b703fa98ce6165c3a;p=platform%2Fupstream%2Fqtdeclarative.git 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 --- 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];