Don't call getmntopts with a null pointer as an option string; it'll

dereference it. Pass optarg from getopts as it should have been done.
This bug caused mount_cd9660 to segfault whenever -o was used.
This commit is contained in:
David Greenman 1994-08-02 11:45:43 +00:00
parent e05db2e2a5
commit 87006abef6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=1819

View file

@ -75,9 +75,8 @@ main(argc, argv)
{
struct iso_args args;
int ch, mntflags, opts;
char *dev, *dir, *options;
char *dev, *dir;
options = NULL;
mntflags = opts = 0;
while ((ch = getopt(argc, argv, "ego:r")) != EOF)
switch (ch) {
@ -88,7 +87,7 @@ main(argc, argv)
opts |= ISOFSMNT_GENS;
break;
case 'o':
getmntopts(options, mopts, &mntflags);
getmntopts(optarg, mopts, &mntflags);
break;
case 'r':
opts |= ISOFSMNT_NORRIP;