From e05db2e2a5dbccfd1ad06260acb6e28bd91e2f2e Mon Sep 17 00:00:00 2001 From: David Greenman Date: Tue, 2 Aug 1994 11:42:10 +0000 Subject: [PATCH] Fixed NULL pointer dereference that occured when any options were specified. --- sbin/mount/mount.c | 4 +++- sbin/mount_ifs/mount.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index f0ff782f4e0e..d16b3d6b5543 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -261,11 +261,13 @@ mountfs(vfstype, spec, name, flags, options, mntopts) warn("%s", mntpath); return (1); } + if (mntopts == NULL) + mntopts = ""; name = mntpath; if (options == NULL) { - if (mntopts == NULL || *mntopts == '\0') + if (*mntopts == '\0') options = "rw"; else options = mntopts; diff --git a/sbin/mount_ifs/mount.c b/sbin/mount_ifs/mount.c index f0ff782f4e0e..d16b3d6b5543 100644 --- a/sbin/mount_ifs/mount.c +++ b/sbin/mount_ifs/mount.c @@ -261,11 +261,13 @@ mountfs(vfstype, spec, name, flags, options, mntopts) warn("%s", mntpath); return (1); } + if (mntopts == NULL) + mntopts = ""; name = mntpath; if (options == NULL) { - if (mntopts == NULL || *mntopts == '\0') + if (*mntopts == '\0') options = "rw"; else options = mntopts;