mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-09-10 17:15:43 +00:00
Add extra tests to the MassStorage device demo and class driver for validating command blocks from the host.
This commit is contained in:
@@ -256,6 +256,8 @@ static bool ReadInCommandBlock(void)
|
||||
/* Verify the command block - abort if invalid */
|
||||
if ((CommandBlock.Signature != CBW_SIGNATURE) ||
|
||||
(CommandBlock.LUN >= TOTAL_LUNS) ||
|
||||
(CommandBlock.Flags & 0x1F) ||
|
||||
(CommandBlock.SCSICommandLength == 0) ||
|
||||
(CommandBlock.SCSICommandLength > MAX_SCSI_COMMAND_LENGTH))
|
||||
{
|
||||
/* Stall both data pipes until reset by host */
|
||||
|
||||
Reference in New Issue
Block a user