From: Nathan Scott Date: Thu, 28 Jul 2005 06:02:26 +0000 (+0000) Subject: Do not dereference null xfs_mount pointer if we fail to initialise. X-Git-Tag: v2.7.0~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d1ee9d75be26b7b199a38983d16e009614f5f210;p=thirdparty%2Fxfsprogs-dev.git Do not dereference null xfs_mount pointer if we fail to initialise. Merge of master-melb:xfs-cmds:23294a by kenmcd. --- diff --git a/db/init.c b/db/init.c index 39133054e..520da64d0 100644 --- 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();