aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2011-12-18 15:33:52 +0100
committerQt by Nokia <qt-info@nokia.com>2012-04-04 20:22:01 +0200
commit95cb2a1b5caf7d7158dd1176380c1458ea22b54f (patch)
tree87a364ee6503ed14d479b775ecaf63171ebbe6c4
parent921882080470aa82055cf400ef0d291a03065bb9 (diff)
Fix access to uninitialised memory that might lead to crashes
QMetaObject is POD, so its constructor is implicit and trivial (doesn't initialise anything). QAbstractDynamicMetaObject doesn't add a constructor, so the QMetaObject sub-object remains uninitialised. The users of either class must ensure they initialise the members if they will be accessed. Change-Id: Ibb7f55ff23b78afb1fcb87382b30c8a28804c028 Task: QTBUG-23214 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
-rw-r--r--src/qml/qml/qqmlscript.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlscript.cpp b/src/qml/qml/qqmlscript.cpp
index b1bb5ed866..5104ba8979 100644
--- a/src/qml/qml/qqmlscript.cpp
+++ b/src/qml/qml/qqmlscript.cpp
@@ -66,6 +66,11 @@ QQmlScript::Object::Object()
: type(-1), idIndex(-1), metatype(0), synthCache(0), defaultProperty(0), parserStatusCast(-1),
componentCompileState(0), nextAliasingObject(0), nextIdObject(0)
{
+ // initialize the members in the meta object
+ extObject.d.superdata = 0;
+ extObject.d.stringdata = 0;
+ extObject.d.data = 0;
+ extObject.d.extradata = 0;
}
QQmlScript::Object::~Object()