diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-02-02 14:47:13 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-02-02 15:57:57 (GMT) |
commit | 6f313a63d4155b53659917a3f7a71f4de60d0d91 (patch) | |
tree | 921073cedf9ece8571dcc9c6fe8a0145b1b79fab /src/corelib | |
parent | 5a74d76d9fe9f2a49f5e0d062da590ecc08cf9bb (diff) | |
download | Qt-6f313a63d4155b53659917a3f7a71f4de60d0d91.zip Qt-6f313a63d4155b53659917a3f7a71f4de60d0d91.tar.gz Qt-6f313a63d4155b53659917a3f7a71f4de60d0d91.tar.bz2 |
Crash in QFileSystemEngine::canonicalName with older libc version
Crashed on OpenBSD.
POSIX.1-2001 says that the behavior if resolved_path is NULL is
implementation-defined. POSIX.1-2008 specifies that the it can
be NULL
Reviewed-By: Markus Goetz
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 6acd811..8b88ffd 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -174,8 +174,9 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, if (entry.isEmpty() || entry.isRoot()) return entry; -#ifdef __UCLIBC__ - return QFileSystemEntry::slowCanonicalName(entry); +#if !defined(Q_OS_MAC) && _POSIX_VERSION < 200809L + // realpath(X,0) is not supported + return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath())); #else char *ret = 0; # if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) |