summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-01-17 18:18:18 -0500
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-13 21:23:39 +0200
commit83c7d19e2a96010724b281bae3410fd764e5d908 (patch)
treeb03109c39ed5a8c72eb432f68ae6a72621626df2 /src
parentf031838539934ee17e5789c852b11e2137e0426d (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. Task: QTBUG-23214 cherry-picked from qt5 95cb2a1b5caf7d7158dd1176380c1458ea22b54f Change-Id: If0e6b129e1bddc3b70feafa4b318280bb715ab04 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qdeclarativeparser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativeparser.cpp b/src/declarative/qml/qdeclarativeparser.cpp
index 4e13e427f3..1bff0b7939 100644
--- a/src/declarative/qml/qdeclarativeparser.cpp
+++ b/src/declarative/qml/qdeclarativeparser.cpp
@@ -68,6 +68,11 @@ using namespace QDeclarativeParser;
QDeclarativeParser::Object::Object()
: type(-1), majorVersion(-1), minorVersion(-1), idIndex(-1), metatype(0), synthCache(0), defaultProperty(0), parserStatusCast(-1)
{
+ // initialize the members in the meta object
+ extObject.d.superdata = 0;
+ extObject.d.stringdata = 0;
+ extObject.d.data = 0;
+ extObject.d.extradata = 0;
}
QDeclarativeParser::Object::~Object()