mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 05:36:22 +00:00
scst/src/dev_handlers/scst_vdisk.c: Avoid that Coverity complains about an out-of-bounds access
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7806 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -3857,7 +3857,8 @@ static int vdisk_usn_vpd(uint8_t *buf, struct scst_cmd *cmd,
|
||||
} else {
|
||||
read_lock(&vdisk_serial_rwlock);
|
||||
usn_len = strlen(virt_dev->usn);
|
||||
WARN_ON_ONCE(usn_len > max_len);
|
||||
if (WARN_ON_ONCE(usn_len > max_len))
|
||||
usn_len = max_len;
|
||||
memcpy(&buf[4], virt_dev->usn, usn_len);
|
||||
read_unlock(&vdisk_serial_rwlock);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user