Author: sbruno
Date: Thu Oct  3 22:52:03 2013
New Revision: 256032
URL: http://svnweb.freebsd.org/changeset/base/256032

Log:
  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 <mikemandar...@gmail.com> during his
  fuse.glusterfs port to FreeBSD.
  
  Final patch from mckusick@
  
  Submitted by: mckusick@
  Approved by:  re (hrs)
  MFC after:    2 weeks

Modified:
  head/sys/kern/vfs_mount.c

Modified: head/sys/kern/vfs_mount.c
==============================================================================
--- head/sys/kern/vfs_mount.c   Thu Oct  3 21:46:43 2013        (r256031)
+++ head/sys/kern/vfs_mount.c   Thu Oct  3 22:52:03 2013        (r256032)
@@ -656,7 +656,7 @@ vfs_donmount(struct thread *td, uint64_t
         * 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;
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to