diff mbox

mISDN: Read buffer overflow

Message ID 4A72F51F.3000503@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

roel kluin July 31, 2009, 1:43 p.m. UTC
Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
--
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

Comments

Karsten Keil July 31, 2009, 2:28 p.m. UTC | #1
On Freitag, 31. Juli 2009 15:43:59 Roel Kluin wrote:

Ouch !
Acked-by: Karsten Keil <keil@b1-systems.de>

> Check whether index is within bounds before testing the element.
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> 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;

--
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
David Miller Aug. 2, 2009, 7:31 p.m. UTC | #2
From: Roel Kluin <roel.kluin@gmail.com>
Date: Fri, 31 Jul 2009 15:43:59 +0200

> Check whether index is within bounds before testing the element.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Applied.
--
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 mbox

Patch

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;