diff options
| author | Andy Shaw <[email protected]> | 2013-06-10 21:56:30 +0200 |
|---|---|---|
| committer | The Qt Project <[email protected]> | 2013-06-11 07:46:29 +0200 |
| commit | 01b6eea4157a7a3d45e55e3ada9786aaaccb99fb (patch) | |
| tree | bd0253acfcfd826a2e3eab23aeb405e235b1b6af /src | |
| parent | 809bd1db8c63d246ac97446b09ac9ccc73be95aa (diff) | |
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 <[email protected]>
Reviewed-by: Janne Anttila <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/corelib/io/qfsfileengine_win.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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(); } |
