]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Do not dereference null xfs_mount pointer if we fail to initialise.
authorNathan Scott <nathans@sgi.com>
Thu, 28 Jul 2005 06:02:26 +0000 (06:02 +0000)
committerNathan Scott <nathans@sgi.com>
Thu, 28 Jul 2005 06:02:26 +0000 (06:02 +0000)
Merge of master-melb:xfs-cmds:23294a by kenmcd.

db/init.c

index 39133054e77bc0f46ee3111f13a9a231882b8992..520da64d027e43b436edbf40126589dbffc5e4ea 100644 (file)
--- a/db/init.c
+++ b/db/init.c
@@ -139,7 +139,11 @@ init(
 
        mp = libxfs_mount(&xmount, sbp, x.ddev, x.logdev, x.rtdev,
                                LIBXFS_MOUNT_ROOTINOS | LIBXFS_MOUNT_DEBUGGER);
-
+       if (!mp) {
+               dbprintf(_("%s: device %s unusable (not an XFS filesystem?)\n"),
+                       progname, fsdevice);
+               exit(1);
+       }
        blkbb = 1 << mp->m_blkbb_log;
 
        push_cur();