Add extra tests to the MassStorage device demo and class driver for validating command blocks from the host.
This commit is contained in:
parent
67f390fe74
commit
d0db78432f
2 changed files with 4 additions and 0 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue