提交 ef3f7cc4 编写于 作者: R Roel Kluin 提交者: Linus Torvalds

osst: fix read buffer overflow

Check whether index is within bounds before testing the element.
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Cc: Willem Riede <osst@riede.org>
Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 13bcbc00
......@@ -5868,7 +5868,8 @@ static int osst_probe(struct device *dev)
}
/* find a free minor number */
for (i=0; os_scsi_tapes[i] && i<osst_max_dev; i++);
for (i = 0; i < osst_max_dev && os_scsi_tapes[i]; i++)
;
if(i >= osst_max_dev) panic ("Scsi_devices corrupt (osst)");
dev_num = i;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册