Details
Description
Application crashes on QApplication instantiation due to out of memory in QFSFileEnginePrivate::canonicalized() if current directory is a symbolic link.
The cause is bug in GetFullPathName() WinAPI function: if initial path is just drive letter with colon (for example 'd:') then it's expanded to current directory on this drive ('d:\current\directory', NOT 'd:\'). So if current directory is a symbolic link to another directory (say 'd:\real\directory') then QFSFileEnginePrivate::isSymlink('d:') returns true (which is not truth actually), since it uses GetFullPathName() to expand path first. QFileInfo::symLinkTarget() is affected too and returns 'd:\real\directory' for 'd:'. Note that 'd:\' (with backslash) is expanded by GetFullPathName() to 'd:\' without changes.
As a result 'd:' is replaced by 'd:\real\directory' in endless loop until out of memory (see QFSFileEnginePrivate::canonicalized()).
Proposed solution is workaround in nativeAbsoluteFilePath(). See attached patch.