mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
osst: fix read buffer overflow
Check whether index is within bounds before testing the element. Signed-off-by: Roel Kluin <[email protected]> Cc: Willem Riede <[email protected]> Cc: James E.J. Bottomley <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
13bcbc0087
commit
ef3f7cc412
1 changed files with 2 additions and 1 deletions
|
|
@ -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