osst: fix read buffer overflow
Check whether index is within bounds before testing the element. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Willem Riede <osst@riede.org> Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
13bcbc0087
commit
ef3f7cc412
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue