diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-01-17 23:18:18 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-13 19:23:39 (GMT) |
commit | 83c7d19e2a96010724b281bae3410fd764e5d908 (patch) | |
tree | b03109c39ed5a8c72eb432f68ae6a72621626df2 /src | |
parent | f031838539934ee17e5789c852b11e2137e0426d (diff) | |
download | Qt-83c7d19e2a96010724b281bae3410fd764e5d908.zip Qt-83c7d19e2a96010724b281bae3410fd764e5d908.tar.gz Qt-83c7d19e2a96010724b281bae3410fd764e5d908.tar.bz2 |
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.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativeparser.cpp b/src/declarative/qml/qdeclarativeparser.cpp index 4e13e42..1bff0b7 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() |