All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] osst: Read buffer overflow
@ 2009-08-02  8:34 Roel Kluin
  0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2009-08-02  8:34 UTC (permalink / raw)
  To: James.Bottomley, linux-scsi, Andrew Morton

Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index acb8358..ddb3d06 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -5860,7 +5860,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;
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-08-02  8:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-02  8:34 [PATCH] osst: Read buffer overflow Roel Kluin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.