Browse files

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
  • Loading branch information...
1 parent aae6234 commit 6b64ef7266faf590b6c21b48b942940be4dca877 @seanbruno seanbruno committed Oct 3, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 sys/kern/vfs_mount.c
View
2 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;
}

0 comments on commit 6b64ef7

Please sign in to comment.