diff options
author | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-08-09 11:42:26 (GMT) |
---|---|---|
committer | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-08-09 11:49:40 (GMT) |
commit | 7829343dc9e12befd6c471cc72d00139bad5d42b (patch) | |
tree | 904c8a77d4799ba6218fad29a98ebe6482b7265b /src/corelib | |
parent | 45f6c749ff5f1773a5a52f1b40278ad390f3ae59 (diff) | |
download | Qt-7829343dc9e12befd6c471cc72d00139bad5d42b.zip Qt-7829343dc9e12befd6c471cc72d00139bad5d42b.tar.gz Qt-7829343dc9e12befd6c471cc72d00139bad5d42b.tar.bz2 |
CreateFileMapping returns NULL on error , only tested with INVALID_HANDLE_VALUE.
That code is deprecated for the most part, however under certain
circumstances could be run. The fix is to check the value when using
the deprecated code and change the return value to follow the logic of
the new code.
Task-number: QTBUG-12732
Reviewed-by: João Abecasis
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qfsfileengine_win.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 21930e1..35fa04b 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1958,6 +1958,10 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + // Since this is a special case, we check if the return value was NULL and if so + // we change it to INVALID_HANDLE_VALUE to follow the logic inside this function. + if(0 == handle) + handle = INVALID_HANDLE_VALUE; #endif if (handle == INVALID_HANDLE_VALUE) { |