mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-21 21:41:09 +00:00
Assure msc device block size is not zero
This commit is contained in:
parent
32bdf3b79d
commit
db862ae725
@ -187,6 +187,11 @@ uint8_t rdwr10_validate_cmd(msc_cbw_t const* cbw)
|
||||
TU_LOG(MSC_DEBUG, " SCSI case 4 Hi > Dn\r\n");
|
||||
status = MSC_CSW_STATUS_FAILED;
|
||||
}
|
||||
else if ( SCSI_CMD_READ_10 == cbw->command[0] && cbw->total_bytes / block_count == 0)
|
||||
{
|
||||
TU_LOG(MSC_DEBUG, " Computed block size 0\r\n");
|
||||
status = MSC_CSW_STATUS_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
|
Loading…
x
Reference in New Issue
Block a user