From patchwork Fri Jul 31 13:43:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 30429 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 51D11B7B69 for ; Fri, 31 Jul 2009 23:41:09 +1000 (EST) Received: by ozlabs.org (Postfix) id 4430FDDDA2; Fri, 31 Jul 2009 23:41:09 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id B042ADDD1B for ; Fri, 31 Jul 2009 23:41:08 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751370AbZGaNk6 (ORCPT ); Fri, 31 Jul 2009 09:40:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751367AbZGaNk6 (ORCPT ); Fri, 31 Jul 2009 09:40:58 -0400 Received: from ey-out-2122.google.com ([74.125.78.24]:9107 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750896AbZGaNk5 (ORCPT ); Fri, 31 Jul 2009 09:40:57 -0400 Received: by ey-out-2122.google.com with SMTP id 9so566030eyd.37 for ; Fri, 31 Jul 2009 06:40:56 -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=cQOy1nPZp0UO4k6nDPT1jxAWe2fa0FXwkOGA1MZnBJI=; b=eNevsG6D7kU7HSqDhqPyuVGuWotXO3qyS2Ixw8rhNkhV/2jccuem+i9BAeq1z/2bY/ 0KkVzACyLEf2r62XOo6qE7I2ZbXQ68fPAUKDtlkAnd64UsXi63KEB18KFk2kDj9AITFa QKO2H2Lv39wpBWCU+FxO9eBqjvyx5vWv3CqGM= 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=cZJEcw+lMIM2dMnrJwh7uw5cStgDzAhcx7Glq/IdG3JdqGP3XwtL4sHOCreP5zyH8j QHYQSJ83PVlKcexm19gzqgBXt8XwT/5TzTKaaQj87JRDoVWnyG6/e5EJa0aqph+/UA03 7OLDsTOD3WtilAS/7mOn0iFXonkkQl0JEesEI= Received: by 10.216.16.212 with SMTP id h62mr486998weh.201.1249047656378; Fri, 31 Jul 2009 06:40:56 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 28sm3552551eyg.20.2009.07.31.06.40.55 (version=SSLv3 cipher=RC4-MD5); Fri, 31 Jul 2009 06:40:55 -0700 (PDT) Message-ID: <4A72F51F.3000503@gmail.com> Date: Fri, 31 Jul 2009 15:43:59 +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: isdn@linux-pingi.de, netdev , Andrew Morton Subject: [PATCH] mISDN: Read buffer overflow Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Check whether index is within bounds before testing the element. Signed-off-by: Roel Kluin Acked-by: Karsten Keil --- -- To unsubscribe from this list: send the line "unsubscribe netdev" 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/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c index c3b661a..7e5f30d 100644 --- a/drivers/isdn/mISDN/l1oip_core.c +++ b/drivers/isdn/mISDN/l1oip_core.c @@ -1480,7 +1480,7 @@ l1oip_init(void) return -ENOMEM; l1oip_cnt = 0; - while (type[l1oip_cnt] && l1oip_cnt < MAX_CARDS) { + while (l1oip_cnt < MAX_CARDS && type[l1oip_cnt]) { switch (type[l1oip_cnt] & 0xff) { case 1: pri = 0;