From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:48:15 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4B07106564A; Sun, 2 Nov 2008 19:48:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2E068FC0A; Sun, 2 Nov 2008 19:48:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2JmF0c046703; Sun, 2 Nov 2008 19:48:15 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2JmFtl046702; Sun, 2 Nov 2008 19:48:15 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811021948.mA2JmFtl046702@svn.freebsd.org> From: Robert Watson Date: Sun, 2 Nov 2008 19:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184567 - head/contrib/smbfs/lib/smb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 19:48:15 -0000 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) {