projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
13bcbc0
)
osst: fix read buffer overflow
author
Roel Kluin
<
[email protected]
>
Wed, 11 Aug 2010 01:01:10 +0000
(18:01 -0700)
committer
Linus Torvalds
<
[email protected]
>
Wed, 11 Aug 2010 15:58:59 +0000
(08:58 -0700)
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]
>
drivers/scsi/osst.c
patch
|
blob
|
history
diff --git
a/drivers/scsi/osst.c
b/drivers/scsi/osst.c
index d64b7178fa088a3eb24453affaa6e5782037d195..278b352ae78d0bdc6d5609f7d62bfc9893111a00 100644
(file)
--- a/
drivers/scsi/osst.c
+++ b/
drivers/scsi/osst.c
@@
-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;