From d3baefa8090b68fb04253a0b10671a1d0620bf6a Mon Sep 17 00:00:00 2001 From: Sean Bruno Date: Thu, 3 Oct 2013 22:52:03 +0000 Subject: [PATCH] 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 during his fuse.glusterfs port to FreeBSD. Final patch from mckusick@ Submitted by: mckusick@ Approved by: re (hrs) MFC after: 2 weeks --- sys/kern/vfs_mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 8f92e10b69b9..7dd1c72820b3 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; }