From 6144cd83d3bcc9783da54e0538c00642690d515d Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 13 Sep 2011 14:08:20 +0100 Subject: 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 --- src/corelib/io/qfsfileengine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- cgit v0.12