Bugs found

From Smop.co.uk

Jump to: navigation, search

It's often easier to find bugs than to write bug-free code :-)

writeBulkCBW:

  • USB spec says this should always be 31 bytes - currently it is (15 + bCBWCBlength)
  • bCBWCBlength should really be checked to ensure it is between 1 and 16 inclusive

readBulkCSW:

  • Should check the signature and make sure it is a CSW block
  • Should check the tag and make sure it is the one we sent out
  • Should check residue
  • Should check status (0=good, 1=failed, 2=phase error). Most calling functions check this instead.

Reset should do these in order as required - startup does the last two unconditionally:

  • Bulk only mass storage reset
  • Clear feature halt bulk-in
  • Clear feature halt bulk-out

getDiskSpace:

  • trace says "write" but it's actually a read

getDirEntries:

  • trace says "write" but it's actually a read

checkFile:

  • (at the bottom) rather than the slow byte comparison * 1000, use memcmp
Personal tools