commit ca59eb345cfef368242929ea33beca4bff837e9d
Author: Dan Vrátil <dvratil@redhat.com>
Date:   Thu Sep 18 16:54:26 2014 +0200

    Don't crash when setmntent returns NULL
    
    setmntent can fail when there's no /etc/mtab file for instance and
    passing NULL pointer to getmntent crashes, so we need to return when
    this happens.

diff --git a/server/src/utils.cpp b/server/src/utils.cpp
index b04a812..b51c330 100644
--- a/server/src/utils.cpp
+++ b/server/src/utils.cpp
@@ -179,6 +179,9 @@ QString Utils::getDirectoryFileSystem(const QString &directory)
     QString bestMatchFS;
 
     FILE *mtab = setmntent("/etc/mtab", "r");
+    if (!mtab) {
+        return QString();
+    }
     while (mntent *mnt = getmntent(mtab)) {
         if (qstrcmp(mnt->mnt_type, MNTTYPE_IGNORE) == 0) {
             continue;
