浏览代码

mISDN: Read buffer overflow

Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
roel kluin 16 年之前
父节点
当前提交
9bfdac94c7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/isdn/mISDN/l1oip_core.c

+ 1 - 1
drivers/isdn/mISDN/l1oip_core.c

@@ -1480,7 +1480,7 @@ l1oip_init(void)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
 	l1oip_cnt = 0;
 	l1oip_cnt = 0;
-	while (type[l1oip_cnt] && l1oip_cnt < MAX_CARDS) {
+	while (l1oip_cnt < MAX_CARDS && type[l1oip_cnt]) {
 		switch (type[l1oip_cnt] & 0xff) {
 		switch (type[l1oip_cnt] & 0xff) {
 		case 1:
 		case 1:
 			pri = 0;
 			pri = 0;