提交 80c6e3c0 编写于 作者: E Eric Sesterhenn 提交者: James Bottomley

[SCSI] fix scsi_device_types overrun in scsi.c

this overrun was spotted by coverity (cid #1403).

If type == ARRAY_SIZE(scsi_device_types), we are off by one.
Signed-off-by: NEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 7b75b990
......@@ -128,7 +128,7 @@ const char * scsi_device_type(unsigned type)
return "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];
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册