From 01b6eea4157a7a3d45e55e3ada9786aaaccb99fb Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 10 Jun 2013 21:56:30 +0200 Subject: [PATCH] When the file could not be accessed, we should return 0 for the size Some functions rely on the size to be sure that the file can be read from. Therefore when nativeSize() fails to access the file we should return 0 instead of a random size to prevent these functions from acting as if there is a valid file to read from. Task-number: QTBUG-31571 Change-Id: I589fc199760ba40ef2e63047b2f226cb196f7e56 Reviewed-by: Thiago Macieira Reviewed-by: Janne Anttila --- src/corelib/io/qfsfileengine_win.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index fca1a446cec..2b38019674c 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -255,6 +255,7 @@ qint64 QFSFileEnginePrivate::nativeSize() const if (!filled) { thatQ->setError(QFile::UnspecifiedError, qt_error_string(errno)); + return 0; } return metaData.size(); }