diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2009-07-21 04:46:48 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2009-07-21 04:46:48 +0000 |
| commit | 597b4dc67cbc053a74e57cfe4f16c52a6302b4a6 (patch) | |
| tree | 2948ff66baa056b040aa1d2ee3f570e5dde5913a /Demos/Device/LowLevel/MassStorage/MassStorage.c | |
| parent | 33f3ec44a4792d055ca4722a38b1e76d87cae5f0 (diff) | |
Add extra tests to the MassStorage device demo and class driver for validating command blocks from the host.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@674 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Demos/Device/LowLevel/MassStorage/MassStorage.c')
| -rw-r--r-- | Demos/Device/LowLevel/MassStorage/MassStorage.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.c b/Demos/Device/LowLevel/MassStorage/MassStorage.c index ebb8e5c4..2c80fc59 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.c +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.c @@ -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 */
|
