svn commit: r185437 - in stable/7/contrib/smbfs: . lib/smb

Robert Watson rwatson at FreeBSD.org
Sat Nov 29 06:49:57 PST 2008


Author: rwatson
Date: Sat Nov 29 14:49:56 2008
New Revision: 185437
URL: http://svn.freebsd.org/changeset/base/185437

Log:
  Merge r184567 from head to stable/7:
  
    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.
  
    Obtained from:       Apple, Inc.
  
  Approved by:	re (kensmith)

Modified:
  stable/7/contrib/smbfs/   (props changed)
  stable/7/contrib/smbfs/lib/smb/nb_name.c

Modified: stable/7/contrib/smbfs/lib/smb/nb_name.c
==============================================================================
--- stable/7/contrib/smbfs/lib/smb/nb_name.c	Sat Nov 29 14:34:30 2008	(r185436)
+++ stable/7/contrib/smbfs/lib/smb/nb_name.c	Sat Nov 29 14:49:56 2008	(r185437)
@@ -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) {


More information about the svn-src-stable-7 mailing list