diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-07-21 04:46:48 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-07-21 04:46:48 +0000 |
commit | d0db78432fc02bacbd57cc9f15eb05b4e56981cb (patch) | |
tree | 2948ff66baa056b040aa1d2ee3f570e5dde5913a /LUFA/Drivers/USB/Class/Device | |
parent | 67f390fe746ccc4d1dceac23f590eb1723cb7ff2 (diff) | |
download | lufa-d0db78432fc02bacbd57cc9f15eb05b4e56981cb.tar.gz lufa-d0db78432fc02bacbd57cc9f15eb05b4e56981cb.tar.bz2 lufa-d0db78432fc02bacbd57cc9f15eb05b4e56981cb.zip |
Add extra tests to the MassStorage device demo and class driver for validating command blocks from the host.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device')
-rw-r--r-- | LUFA/Drivers/USB/Class/Device/MassStorage.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/MassStorage.c b/LUFA/Drivers/USB/Class/Device/MassStorage.c index ceb4b9647..f7f3fd9f2 100644 --- a/LUFA/Drivers/USB/Class/Device/MassStorage.c +++ b/LUFA/Drivers/USB/Class/Device/MassStorage.c @@ -149,6 +149,8 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte if ((MSInterfaceInfo->State.CommandBlock.Signature != MS_CBW_SIGNATURE) ||
(MSInterfaceInfo->State.CommandBlock.LUN >= MSInterfaceInfo->Config.TotalLUNs) ||
+ (MSInterfaceInfo->State.CommandBlock.Flags & 0x1F) ||
+ (MSInterfaceInfo->State.CommandBlock.SCSICommandLength == 0) ||
(MSInterfaceInfo->State.CommandBlock.SCSICommandLength > 16))
{
Endpoint_StallTransaction();
|