From: roel kluin Date: Fri, 31 Jul 2009 03:43:59 +0000 (+0000) Subject: mISDN: Read buffer overflow X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9bfdac94c78faf68ce038d5c45a385927f2667ce;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mISDN: Read buffer overflow Check whether index is within bounds before testing the element. Signed-off-by: Roel Kluin Acked-by: Karsten Keil Signed-off-by: David S. Miller --- diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c index 990e6a7e6674..0ebce046ade4 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;