Commit ef3f7cc4 authored by Roel Kluin's avatar Roel Kluin Committed by Linus Torvalds

osst: fix read buffer overflow

Check whether index is within bounds before testing the element.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Willem Riede <osst@riede.org>
Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 13bcbc00
...@@ -5868,7 +5868,8 @@ static int osst_probe(struct device *dev) ...@@ -5868,7 +5868,8 @@ static int osst_probe(struct device *dev)
} }
/* find a free minor number */ /* 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)"); if(i >= osst_max_dev) panic ("Scsi_devices corrupt (osst)");
dev_num = i; dev_num = i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment