aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativeproperty.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2011-05-05 13:24:32 +1000
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-11 17:00:06 +0200
commitdb49ce3f88653fffd6aa967a7acd73058ba1f214 (patch)
tree0bdc243fe464e419bff3bf2f9afc991d4b0309a2 /src/declarative/qml/qdeclarativeproperty.cpp
parent15407cfb5f4eb8e24e55f2ac6eb5a3b9f6e8ebae (diff)
Uninitialized memory is compared.
Memory is allocated and used without first clearing it. At the least this annoys valgrind, but also has potential for real problems. Change-Id: Icf3fd39f44ee0481dd732510e7f8b3ad6cef477d Task-number: QTBUG-15187 Reviewed-by: Aaron Kennedy (cherry picked from commit 95aa4e4f9b82c3652ffc93310b190db869d491df)
Diffstat (limited to 'src/declarative/qml/qdeclarativeproperty.cpp')
-rw-r--r--src/declarative/qml/qdeclarativeproperty.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp
index 7f74da4ee6..253d7447e2 100644
--- a/src/declarative/qml/qdeclarativeproperty.cpp
+++ b/src/declarative/qml/qdeclarativeproperty.cpp
@@ -1451,6 +1451,7 @@ QByteArray QDeclarativePropertyPrivate::saveValueType(const QMetaObject *metaObj
QMetaProperty subProp = subObject->property(subIndex);
ValueTypeSerializedData sd;
+ memset(&sd, 0, sizeof(sd));
sd.isValueType = true;
sd.core.load(metaObject->property(index));
sd.valueType.flags = QDeclarativePropertyCache::Data::flagsForProperty(subProp);
@@ -1465,6 +1466,7 @@ QByteArray QDeclarativePropertyPrivate::saveValueType(const QMetaObject *metaObj
QByteArray QDeclarativePropertyPrivate::saveProperty(const QMetaObject *metaObject, int index)
{
SerializedData sd;
+ memset(&sd, 0, sizeof(sd));
sd.isValueType = false;
sd.core.load(metaObject->property(index));