diff options
author | João Abecasis <joao@abecasis.name> | 2009-11-19 16:15:03 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-11-23 12:14:54 (GMT) |
commit | fc5a9af7c6470646b82546ec2e5e37f68d4d238d (patch) | |
tree | 67ef3e383f15dc74ef6783125f36dc0d78f14a16 | |
parent | 6adeb8be007bfdeaeb7e1d4a730abf32dbdb0f7d (diff) | |
download | Qt-fc5a9af7c6470646b82546ec2e5e37f68d4d238d.zip Qt-fc5a9af7c6470646b82546ec2e5e37f68d4d238d.tar.gz Qt-fc5a9af7c6470646b82546ec2e5e37f68d4d238d.tar.bz2 |
Revert check for file size to a warning in QFile::map
The check, introduced in c66de8a19b558e14097c402480eeabf0b5ec2351,
changes behavior and it is not clear whether we should prevent
mmaping beyond EOF. FWIW, python prevents it.
Leaving a warning in there for now so as not to break applications that
depend on the feature.
Task-number: QTBUG-6008
Reviewed-by: Thiago Macieira
(cherry picked from commit 095c92f03e0c01b878eaa0cd1b7844171ce9241f)
-rw-r--r-- | src/corelib/io/qfsfileengine_unix.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 0cc0f0b..17bc448 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -1254,7 +1254,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla // undefined behavior. Otherwise, let mmap have its say. if (doStat() && (QT_OFF_T(size) > st.st_size - QT_OFF_T(offset))) - return 0; + qWarning("QFSFileEngine::map: Mapping a file beyond its size is not portable"); int access = 0; if (openMode & QIODevice::ReadOnly) access |= PROT_READ; |