Add extra tests to the MassStorage device demo and class driver for validating comman...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Device / MassStorage.c
index ceb4b96..f7f3fd9 100644 (file)
@@ -149,6 +149,8 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte
 \r
        if ((MSInterfaceInfo->State.CommandBlock.Signature         != MS_CBW_SIGNATURE)                  ||\r
            (MSInterfaceInfo->State.CommandBlock.LUN               >= MSInterfaceInfo->Config.TotalLUNs) ||\r
+               (MSInterfaceInfo->State.CommandBlock.Flags              & 0x1F)                              ||\r
+               (MSInterfaceInfo->State.CommandBlock.SCSICommandLength == 0)                                 ||\r
                (MSInterfaceInfo->State.CommandBlock.SCSICommandLength >  16))\r
        {\r
                Endpoint_StallTransaction();\r