Author: rwatson
Date: Sun Nov  2 19:48:15 2008
New Revision: 184567
URL: http://svn.freebsd.org/changeset/base/184567

Log:
  When encoding an smb name, truncate one byte earlier in order than we did
  previously in order to ensure it fit properly in the bufer when encoded.
  This prevents a debugging printf from firing if a source or destination
  host name for an smb mount exceeds 15 characters.
  
  MFC after:    3 days
  Obtained from:        Apple, Inc.

Modified:
  head/contrib/smbfs/lib/smb/nb_name.c

Modified: head/contrib/smbfs/lib/smb/nb_name.c
==============================================================================
--- head/contrib/smbfs/lib/smb/nb_name.c        Sun Nov  2 19:40:24 2008        
(r184566)
+++ head/contrib/smbfs/lib/smb/nb_name.c        Sun Nov  2 19:48:15 2008        
(r184567)
@@ -169,7 +169,7 @@ nb_name_encode(struct nb_name *np, u_cha
                memsetw(cp + 2, NB_NAMELEN - 1, NBENCODE(' '));
                cp += NB_ENCNAMELEN;
        } else {
-               for (i = 0; *name && i < NB_NAMELEN; i++, cp += 2, name++)
+               for (i = 0; *name && i < NB_NAMELEN - 1; i++, cp += 2, name++)
                        *(u_short*)cp = NBENCODE(toupper(*name));
                i = NB_NAMELEN - i - 1;
                if (i > 0) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to