summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorsbruno <sbruno@FreeBSD.org>2013-10-03 22:52:03 +0000
committersbruno <sbruno@FreeBSD.org>2013-10-03 22:52:03 +0000
commit6b64ef7266faf590b6c21b48b942940be4dca877 (patch)
treebe533b3f02ff7f539226aa4a0c409aa7d0461991 /sys/kern
parentaae6234255311ce64facefa4a4d332c68542d3b3 (diff)
downloadFreeBSD-src-6b64ef7266faf590b6c21b48b942940be4dca877.zip
FreeBSD-src-6b64ef7266faf590b6c21b48b942940be4dca877.tar.gz
Change len checks for fstypelen and fspathlen to be against absolute len
not strlen as they are *not* strings. Discovered by GSOC student, Mike Ma <mikemandarine@gmail.com> during his fuse.glusterfs port to FreeBSD. Final patch from mckusick@ Submitted by: mckusick@ Approved by: re (hrs) MFC after: 2 weeks
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_mount.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 8f92e10..7dd1c72 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -656,7 +656,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, struct uio *fsoptions)
* variables will fit in our mp buffers, including the
* terminating NUL.
*/
- if (fstypelen >= MFSNAMELEN - 1 || fspathlen >= MNAMELEN - 1) {
+ if (fstypelen > MFSNAMELEN || fspathlen > MNAMELEN) {
error = ENAMETOOLONG;
goto bail;
}
OpenPOWER on IntegriCloud