From patchwork Sun Aug 2 11:00:18 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 102643 Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4RCZ3bs012803 for ; Thu, 27 May 2010 12:35:43 GMT Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 93DD3AC103; Thu, 27 May 2010 06:34:27 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.8 tests=BAYES_00,SPF_PASS autolearn=ham version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mail-ew0-f219.google.com (mail-ew0-f219.google.com [209.85.219.219]) by lists.samba.org (Postfix) with ESMTP id A0416AC2CA; Sun, 2 Aug 2009 04:54:00 -0600 (MDT) Received: by ewy19 with SMTP id 19so32720ewy.20 for ; Sun, 02 Aug 2009 03:57:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=CubNhnMJSARadcLNYdkhIzEpE/riemzzEeb1dFgv7A4=; b=Stwi6ZD32ZgU+d5P7uaecCR7K9sREErUAPCNyhRTSNLR09P/wBUFyRaaBolb6kfvIK T3e3+rKabT9cGCRFWw0pzVjry+sznZeje16hrYZGi1qqKTEb9Oelx4iE8jhHbHYF9Wnc ULww8zB1uwWFlX2mDh+3LAe9sIv0D9wmjWGSc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=cj9daB0aapEx3jfGqpMcxH/mauczvoMNxImvVK2eIKXWyS40gvV6pZK7RMy3ko1oxd Z4qlBWDghc4W59EttzwLSmPoU0z62ClFZfLiz7tRmwcK23EweEbhL6jYl0b1/3fBSa/I XGFoC2B3jb0ytAR58wzri00IRVXlzT9uxOs3g= Received: by 10.210.63.18 with SMTP id l18mr5898934eba.11.1249210628183; Sun, 02 Aug 2009 03:57:08 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 10sm8865734eyz.41.2009.08.02.03.57.07 (version=SSLv3 cipher=RC4-MD5); Sun, 02 Aug 2009 03:57:07 -0700 (PDT) Message-ID: <4A7571C2.3010901@gmail.com> Date: Sun, 02 Aug 2009 13:00:18 +0200 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: sfrench@samba.org, linux-cifs-client@lists.samba.org, samba-technical@lists.samba.org, Andrew Morton X-Mailman-Approved-At: Thu, 27 May 2010 06:34:18 -0600 Subject: [linux-cifs-client] [PATCH] cifs: Read buffer overflow X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 27 May 2010 12:35:43 +0000 (UTC) diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c index 60e3c42..cfdb831 100644 --- a/fs/cifs/cifs_unicode.c +++ b/fs/cifs/cifs_unicode.c @@ -44,7 +44,7 @@ cifs_ucs2_bytes(const __le16 *from, int maxbytes, int maxwords = maxbytes / 2; char tmp[NLS_MAX_CHARSET_SIZE]; - for (i = 0; from[i] && i < maxwords; i++) { + for (i = 0; i < maxword && from[i]; i++) { charlen = codepage->uni2char(le16_to_cpu(from[i]), tmp, NLS_MAX_CHARSET_SIZE); if (charlen > 0)