]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: paranoid change in mnt_table_is_fs_mounted()
authorKarel Zak <kzak@redhat.com>
Thu, 29 Sep 2016 09:55:07 +0000 (11:55 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 29 Sep 2016 09:55:07 +0000 (11:55 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/tab.c

index 9c49ec885b0ff740f0c12dd9fff187924b89e3e5..f72dcf1c2ea169cc411f802f9f3435e7566e915e 100644 (file)
@@ -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))