diff options
author | rwatson <rwatson@FreeBSD.org> | 2008-11-02 19:48:15 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2008-11-02 19:48:15 +0000 |
commit | b563afb1641962b2b7aed20467423c4338d37ff9 (patch) | |
tree | 141c5b88a4e5b4dedb55f0a335b7d0f75b72c8cb /contrib/smbfs/lib | |
parent | 42fb388946741215df2b55813ca5c11a1c12ebe1 (diff) | |
download | FreeBSD-src-b563afb1641962b2b7aed20467423c4338d37ff9.zip FreeBSD-src-b563afb1641962b2b7aed20467423c4338d37ff9.tar.gz |
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.
Diffstat (limited to 'contrib/smbfs/lib')
-rw-r--r-- | contrib/smbfs/lib/smb/nb_name.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/smbfs/lib/smb/nb_name.c b/contrib/smbfs/lib/smb/nb_name.c index ad34489..2346ec7 100644 --- a/contrib/smbfs/lib/smb/nb_name.c +++ b/contrib/smbfs/lib/smb/nb_name.c @@ -169,7 +169,7 @@ nb_name_encode(struct nb_name *np, u_char *dst) 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) { |