Whamcloud - gitweb
misc: fix test for unavailable mountpoint in tune2fs
authorTheodore Ts'o <tytso@mit.edu>
Wed, 31 Aug 2022 21:01:21 +0000 (17:01 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 31 Aug 2022 21:01:21 +0000 (17:01 -0400)
Addresses-Coverity-Bug: 1510127
Fixes: a83e199da0ca ("tune2fs: Add support for get/set UUID ioctls")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/tune2fs.c

index c07ad52..9f0d437 100644 (file)
@@ -3588,7 +3588,7 @@ _("Warning: The journal is dirty. You may wish to replay the journal like:\n\n"
 
 #ifdef __linux__
                if ((mount_flags & EXT2_MF_MOUNTED) &&
-                   !(mount_flags & EXT2_MF_READONLY) && mntpt) {
+                   !(mount_flags & EXT2_MF_READONLY) && mntpt[0]) {
                        fd = open(mntpt, O_RDONLY);
                        if (fd >= 0)
                                fsuuid = malloc(sizeof(*fsuuid) + UUID_SIZE);