Add extra tests to the MassStorage device demo and class driver for validating comman...
[pub/lufa.git] / Demos / Device / LowLevel / MassStorage / MassStorage.c
index ebb8e5c..2c80fc5 100644 (file)
@@ -256,6 +256,8 @@ static bool ReadInCommandBlock(void)
        /* Verify the command block - abort if invalid */\r
        if ((CommandBlock.Signature         != CBW_SIGNATURE) ||\r
            (CommandBlock.LUN               >= TOTAL_LUNS)    ||\r
+               (CommandBlock.Flags              & 0x1F)          ||\r
+               (CommandBlock.SCSICommandLength == 0)             ||\r
                (CommandBlock.SCSICommandLength >  MAX_SCSI_COMMAND_LENGTH))\r
        {\r
                /* Stall both data pipes until reset by host */\r