Initialize QFileSystemMetaData::size_ data member
There's a code path which reads that member before it got anything assigned to it, triggering undefined behavior. The code path goes as follows: 1. an instance is created in QFSFileEngineIterator::advance 2. the instance is passed to QFileSystemIterator::advance, which fills in only some members (not size_) 3. the instance is passed to QFileInfoPrivate which does a deep copy, reading an uninitialized size_ Change-Id: I6835ee701a83b63ca4bad6235feeb6a23566fcd3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
ec68f67ee5
commit
26fbeecfa5
|
|
@ -74,7 +74,8 @@ class QFileSystemMetaData
|
|||
{
|
||||
public:
|
||||
QFileSystemMetaData()
|
||||
: knownFlagsMask(0)
|
||||
: knownFlagsMask(0),
|
||||
size_(-1)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue