aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2016-09-29 11:55:07 +0200
committerKarel Zak <kzak@redhat.com>2016-09-29 11:55:07 +0200
commit3e44e75dae38cce3423cf5270c5edfd1079ca438 (patch)
treee07ac628931ffa4a9b446e97e6923c593b6cd54f
parent76d4fba2e47808264f5c4c883127b0d275e31949 (diff)
downloadutil-linux-3e44e75dae38cce3423cf5270c5edfd1079ca438.tar.gz
libmount: paranoid change in mnt_table_is_fs_mounted()
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--libmount/src/tab.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
index 9c49ec885b..f72dcf1c2e 100644
--- a/libmount/src/tab.c
+++ b/libmount/src/tab.c
@@ -1577,7 +1577,9 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs)
}
if (root) {
- if (strcmp(mnt_fs_get_fstype(fs), "cifs") == 0) {
+ const char *fstype = mnt_fs_get_fstype(fs);
+
+ if (fstype && strcmp(fstype, "cifs") == 0) {
const char *unc_subdir = get_cifs_unc_subdir_path(src);
const char *path_on_fs = mnt_fs_get_root(fs);
if (!unc_subdir || !path_on_fs || !streq_paths(unc_subdir, path_on_fs))