From 3d406da0c90e319d0e05f75e2dcd485d5954fc1d Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Tue, 17 Apr 2001 04:22:22 +0000 Subject: [PATCH] Fix segfault on `mount -t nfs' reported by Gratien D'haese. --- mount.c | 3 +++ util-linux/mount.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/mount.c b/mount.c index 5b6ec1e71..d1568d803 100644 --- 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"); diff --git a/util-linux/mount.c b/util-linux/mount.c index 5b6ec1e71..d1568d803 100644 --- a/util-linux/mount.c +++ b/util-linux/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"); -- 2.25.1