summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-03-02 20:33:55 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-06 12:10:42 +0100
commitc78957766a5adba45289a0f7afe22949a183b34b (patch)
tree4c8b6fdfe419da36308b7182511af43758dccc53 /src
parente6f84312a5352c742f240385e2814ef9b865db22 (diff)
QMimeDatabase: Fix crash on empty filename
This is due to the search in the suffix tree starting at position fileName.length() - 1. Change-Id: I98501c1724c7dde2626351ace8ba19faa0d2e1e1 Reviewed-by: Ivan Komissarov <ABBAPOH@nextmail.ru> Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp
index 8ef0ee8881..0c2f25a1f9 100644
--- a/src/corelib/mimetypes/qmimeprovider.cpp
+++ b/src/corelib/mimetypes/qmimeprovider.cpp
@@ -283,6 +283,8 @@ QMimeType QMimeBinaryProvider::mimeTypeForName(const QString &name)
QStringList QMimeBinaryProvider::findByFileName(const QString &fileName, QString *foundSuffix)
{
checkCache();
+ if (fileName.isEmpty())
+ return QStringList();
const QString lowerFileName = fileName.toLower();
QMimeGlobMatchResult result;
// TODO this parses in the order (local, global). Check that it handles "NOGLOBS" correctly.