Fix segfault on `mount -t nfs' reported by Gratien D'haese.
authorMatt Kraai <kraai@debian.org>
Tue, 17 Apr 2001 04:22:22 +0000 (04:22 -0000)
committerMatt Kraai <kraai@debian.org>
Tue, 17 Apr 2001 04:22:22 +0000 (04:22 -0000)
mount.c
util-linux/mount.c

diff --git a/mount.c b/mount.c
index 5b6ec1e71ff64c834e8858878f84dfe42666eb0c..d1568d8031a05b16464f2393c13f5f2ece53c899 100644 (file)
--- a/mount.c
+++ b/mount.c
@@ -405,6 +405,9 @@ extern int mount_main(int argc, char **argv)
                argv++;
        }
 
+       if (device == NULL && directory == NULL)
+               goto goodbye;
+
        if (all == TRUE || directory == NULL) {
                struct mntent *m;
                FILE *f = setmntent("/etc/fstab", "r");
index 5b6ec1e71ff64c834e8858878f84dfe42666eb0c..d1568d8031a05b16464f2393c13f5f2ece53c899 100644 (file)
@@ -405,6 +405,9 @@ extern int mount_main(int argc, char **argv)
                argv++;
        }
 
+       if (device == NULL && directory == NULL)
+               goto goodbye;
+
        if (all == TRUE || directory == NULL) {
                struct mntent *m;
                FILE *f = setmntent("/etc/fstab", "r");