diff options
author | dg <dg@FreeBSD.org> | 1994-08-02 11:45:43 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1994-08-02 11:45:43 +0000 |
commit | b0756e8093925874b4bd89aa2e043bb63dffc7fc (patch) | |
tree | d0b6c18eb03c42d0f660d2dc945ee1512d132d41 /sbin/mount_cd9660 | |
parent | 5ccbe6e80aba1c533cf923b4c3b270cfe7eb40eb (diff) | |
download | FreeBSD-src-b0756e8093925874b4bd89aa2e043bb63dffc7fc.zip FreeBSD-src-b0756e8093925874b4bd89aa2e043bb63dffc7fc.tar.gz |
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.
Diffstat (limited to 'sbin/mount_cd9660')
-rw-r--r-- | sbin/mount_cd9660/mount_cd9660.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c index 9ef716d..7f307ea 100644 --- a/sbin/mount_cd9660/mount_cd9660.c +++ b/sbin/mount_cd9660/mount_cd9660.c @@ -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; |