From c71c46430317b70e784f0952d0aac048775ad842 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 24 Nov 2009 09:34:48 +0100 Subject: Fix QFile::map in Linux 64bit On 64bit, qint64(size_t(-1)) = -1 Reviewed-by: Joao Reviewed-by: Thiago (cherry picked from commit 829d9e10ad3d26fb2fddef01c8e36352018c3fec) --- src/corelib/io/qfsfileengine_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 35737b3..8cbf6a3 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -1245,7 +1245,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla } if (offset < 0 || offset != qint64(QT_OFF_T(offset)) - || size < 0 || size > qint64(size_t(-1))) { + || size < 0 || quint64(size) > quint64(size_t(-1))) { q->setError(QFile::UnspecifiedError, qt_error_string(int(EINVAL))); return 0; } -- cgit v0.12