Overrun in drivers/scsi/scsi.c
PATCH 1/1 Overrun in drivers/scsi/scsi.c
hi,
this overrun was spotted by coverity (cid #1403).
If type == ARRAY_SIZE(scsi_device_types), we are off by one.
Signed-off-by Eric Sesterhenn <[email protected]>
drivers/scsi/scsi.c renamed from drivers/scsi/scsi.c.orig +1 -1
@@ -128,7 +128,7 @@ const char * scsi_device_type(unsigned treturn "Well-known LUN " ;if (type ==0x1f )return "No Device " ; -if (type >ARRAY_SIZE (scsi_device_types)) +if (type >=ARRAY_SIZE (scsi_device_types))return "Unknown " ;return scsi_device_types[type]; }