From patchwork Wed Apr 22 13:43:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suresh Jayaraman X-Patchwork-Id: 19349 Received: from lists.samba.org (mail.samba.org [66.70.73.150]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3MDho0H012416 for ; Wed, 22 Apr 2009 13:43:50 GMT Received: from dp.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id E4CE0163CA6 for ; Wed, 22 Apr 2009 13:43:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on dp.samba.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.8 tests=AWL, BAYES_00 autolearn=ham version=3.1.7 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from victor.provo.novell.com (victor.provo.novell.com [137.65.250.26]) by lists.samba.org (Postfix) with ESMTP id 31029163B69 for ; Wed, 22 Apr 2009 13:43:13 +0000 (GMT) Received: from [164.99.138.63] (prv-ext-foundry1.gns.novell.com [137.65.251.240]) by victor.provo.novell.com with ESMTP; Wed, 22 Apr 2009 07:43:25 -0600 Message-ID: <49EF1EF5.8060008@suse.de> Date: Wed, 22 Apr 2009 19:13:17 +0530 From: Suresh Jayaraman User-Agent: Thunderbird 2.0.0.19 (X11/20081227) MIME-Version: 1.0 To: Steve French X-Enigmail-Version: 0.95.7 Cc: "linux-cifs-client@lists.samba.org" , Jeff Layton Subject: [linux-cifs-client] [PATCH 2/5] cifs: Fix cifs_strfromUCS_le to do double-byte NULL termination X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org Errors-To: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org Ensure NULL termination (double-byte) is done here and prevent callers from doing incorrect NULL termination. Signed-off-by: Suresh Jayaraman --- fs/cifs/cifs_unicode.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) linux-cifs-client mailing list linux-cifs-client@lists.samba.org https://lists.samba.org/mailman/listinfo/linux-cifs-client diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c index 7d75272..e7ed048 100644 --- a/fs/cifs/cifs_unicode.c +++ b/fs/cifs/cifs_unicode.c @@ -51,6 +51,8 @@ cifs_strfromUCS_le(char *to, const __le16 *from, } } to[outlen] = 0; + /* ensure double-byte NULL termination */ + to[outlen + 1] = 0; return outlen; } _______________________________________________