diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-09-13 13:08:20 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-09-13 13:18:20 (GMT) |
commit | 6144cd83d3bcc9783da54e0538c00642690d515d (patch) | |
tree | 5ce584460a7e71504578769f446ad5211b9276d6 /src/corelib | |
parent | 0ed694bd074be42272bf795a3add4f55457ddd75 (diff) | |
download | Qt-6144cd83d3bcc9783da54e0538c00642690d515d.zip Qt-6144cd83d3bcc9783da54e0538c00642690d515d.tar.gz Qt-6144cd83d3bcc9783da54e0538c00642690d515d.tar.bz2 |
Fix uninitialised variable in temporary files
The symbianFilePos variable was only initialised in the nativeOpen
function and not in the constructor called init(). Due to the fix
for QTBUG-4796, QTemporaryFile now bypasses the nativeOpen function.
Zero initialising in init() ensures it is always valid (it only needs
a non zero initialisation when opening a file for append, which is
still covered by nativeOpen)
Task-Number: QTBUG-21418
Reviewed-By: mread
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qfsfileengine.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index e1f3123..dd4c40f 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -120,9 +120,12 @@ void QFSFileEnginePrivate::init() openMode = QIODevice::NotOpen; fd = -1; fh = 0; -#if defined (Q_OS_SYMBIAN) && !defined(QT_SYMBIAN_USE_NATIVE_FILEMAP) +#if defined (Q_OS_SYMBIAN) + symbianFilePos = 0; +#if !defined(QT_SYMBIAN_USE_NATIVE_FILEMAP) fileHandleForMaps = -1; #endif +#endif lastIOCommand = IOFlushCommand; lastFlushFailed = false; closeFileHandle = false; |