diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-04-20 16:52:45 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-20 22:23:23 +0200 |
commit | 369863efefb3b63859b9de48915f5f3da65be76a (patch) | |
tree | a93721dd764c825487705637199ec2adb830a654 /src/corelib/kernel | |
parent | fffc900f78a191970c4eebced9c1af016a9ea6f4 (diff) |
Don't push unnecessary data to a data stream for QVariant()
Adjust the test because we don't read past the end anymore.
Task-number: QTBUG-25108
Change-Id: I8243f1d5ae79d1256aab2cb1132598a716a7eeeb
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index c363be86c8..18bef1b4b6 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1705,9 +1705,11 @@ void QVariant::load(QDataStream &s) d.is_null = is_null; if (!isValid()) { + if (s.version() < QDataStream::Qt_5_0) { // Since we wrote something, we should read something - QString x; - s >> x; + QString x; + s >> x; + } d.is_null = true; return; } @@ -1769,7 +1771,8 @@ void QVariant::save(QDataStream &s) const } if (!isValid()) { - s << QString(); + if (s.version() < QDataStream::Qt_5_0) + s << QString(); return; } |