diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 1999-02-15 16:41:38 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 1999-02-15 16:41:38 +0000 |
commit | 33e18dce71a03135ced13cd13cf132c108fad791 (patch) | |
tree | 5910d3d43815bcc0e9a38aaa5d2b5d131dd1328a | |
parent | 0a569ea721153ffade428752f5591053b57423b4 (diff) |
Fail correctly when trying to match a filesystem on the old typenum
and the typenum is out of range
-rw-r--r-- | sys/kern/vfs_syscalls.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index adcaaa4d0fc..f76b99b7e12 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.53 1999/01/19 20:52:47 art Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.54 1999/02/15 16:41:37 art Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -199,17 +199,15 @@ sys_mount(p, v, retval) */ fstypenum = (u_long)SCARG(uap, type); - if (fstypenum < maxvfsconf) { - for (vfsp = vfsconf; vfsp; vfsp = vfsp->vfc_next) - if (vfsp->vfc_typenum == fstypenum) - break; - if (vfsp == NULL) { - vput(vp); - return (ENODEV); - } - strncpy(fstypename, vfsp->vfc_name, MFSNAMELEN); - + for (vfsp = vfsconf; vfsp; vfsp = vfsp->vfc_next) + if (vfsp->vfc_typenum == fstypenum) + break; + if (vfsp == NULL) { + vput(vp); + return (ENODEV); } + strncpy(fstypename, vfsp->vfc_name, MFSNAMELEN); + #else vput(vp); return (error); |