Fixed NULL pointer dereference that occured when any options were

specified.
This commit is contained in:
David Greenman 1994-08-02 11:42:10 +00:00
parent 3c4dd3568f
commit e05db2e2a5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=1818
2 changed files with 6 additions and 2 deletions

View File

@ -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;

View File

@ -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;