1 From ca59eb345cfef368242929ea33beca4bff837e9d Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= <dvratil@redhat.com>
3 Date: Thu, 18 Sep 2014 16:54:26 +0200
4 Subject: [PATCH 06/30] Don't crash when setmntent returns NULL
6 setmntent can fail when there's no /etc/mtab file for instance and
7 passing NULL pointer to getmntent crashes, so we need to return when
10 server/src/utils.cpp | 3 +++
11 1 file changed, 3 insertions(+)
13 diff --git a/server/src/utils.cpp b/server/src/utils.cpp
14 index b04a812..b51c330 100644
15 --- a/server/src/utils.cpp
16 +++ b/server/src/utils.cpp
17 @@ -179,6 +179,9 @@ QString Utils::getDirectoryFileSystem(const QString &directory)
20 FILE *mtab = setmntent("/etc/mtab", "r");
24 while (mntent *mnt = getmntent(mtab)) {
25 if (qstrcmp(mnt->mnt_type, MNTTYPE_IGNORE) == 0) {