From d40088433a96746c1904b9a2fc2999b784fe8850 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 10 Nov 2010 17:40:17 +0100 Subject: Amend commit 27fe0f93f961e78b71cd0b729a0e324b847ec023 It is a typo. Else, it overflows --- src/corelib/tools/qbytearray.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 68789d9..f26d878 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -541,7 +541,7 @@ QByteArray qUncompress(const uchar* data, int nbytes) forever { ulong alloc = len; - if (len >= (2 << 31) - sizeof(QByteArray::Data)) { + if (len >= (1 << 31) - sizeof(QByteArray::Data)) { //QByteArray does not support that huge size anyway. qWarning("qUncompress: Input data is corrupted"); return QByteArray(); @@ -561,7 +561,7 @@ QByteArray qUncompress(const uchar* data, int nbytes) switch (res) { case Z_OK: if (len != alloc) { - if (len >= (2 << 31) - sizeof(QByteArray::Data)) { + if (len >= (1 << 31) - sizeof(QByteArray::Data)) { //QByteArray does not support that huge size anyway. qWarning("qUncompress: Input data is corrupted"); return QByteArray(); -- cgit v0.12