From patchwork Sun Aug 2 07:44:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 38705 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n727fGdO031144 for ; Sun, 2 Aug 2009 07:41:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752133AbZHBHlF (ORCPT ); Sun, 2 Aug 2009 03:41:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752127AbZHBHlE (ORCPT ); Sun, 2 Aug 2009 03:41:04 -0400 Received: from mail-ew0-f214.google.com ([209.85.219.214]:48319 "EHLO mail-ew0-f214.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752125AbZHBHlD (ORCPT ); Sun, 2 Aug 2009 03:41:03 -0400 Received: by ewy10 with SMTP id 10so2372222ewy.37 for ; Sun, 02 Aug 2009 00:41:02 -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=p9U+lF0ANiDR5EuJDi+j8M2t6yTU0zWW25J33I/dI80=; b=Lyy5wY0MNLXnGNUuT3P7MKnMLMF/8gAm4m61GOoFvnymFUxJnWKxC54gcripWm3cNU BbwIWD2HfRx+ol4CsFUeyO5cv2BZXJ+lAWkn5Y4TBakQY/mVlGlqL3rGWowNBgYXiE3o DxT8GVnYfM1n38q/UyfORYoaOPPtE6cStMiVM= 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=R8KtLdyxE6VjqGm1pvpuZ2LA4WG8kG3kunCKLqd4b2XpG6rwSG7P/XDke8DaqCUjRG D7Cwl6GKF3zDPbP56vgcy5uPKMvF/XGLmzzWb86yPnCR4IO3PFV7uZFZG7l1I/wOLJlc 7lHns8z3OoXOQz9upZ/ytOAQX+AbsEwsyvIiI= Received: by 10.210.89.7 with SMTP id m7mr5552924ebb.92.1249198862939; Sun, 02 Aug 2009 00:41:02 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 5sm8678177eyh.26.2009.08.02.00.41.02 (version=SSLv3 cipher=RC4-MD5); Sun, 02 Aug 2009 00:41:02 -0700 (PDT) Message-ID: <4A7543CC.2010206@gmail.com> Date: Sun, 02 Aug 2009 09:44:12 +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: linville@tuxdriver.com, linux-wireless@vger.kernel.org, Andrew Morton Subject: [PATCH] libertas: Read buffer overflow Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Check whether index is within bounds before testing the element. Signed-off-by: Roel Kluin Acked-by: Dan Williams --- -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/libertas/11d.c b/drivers/net/wireless/libertas/11d.c index 9a5408e..5c69681 100644 --- a/drivers/net/wireless/libertas/11d.c +++ b/drivers/net/wireless/libertas/11d.c @@ -47,7 +47,7 @@ static u8 lbs_region_2_code(u8 *region) { u8 i; - for (i = 0; region[i] && i < COUNTRY_CODE_LEN; i++) + for (i = 0; i < COUNTRY_CODE_LEN && region[i]; i++) region[i] = toupper(region[i]); for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) {