stedolan / crowbar

Property fuzzing for OCaml
MIT License
183 stars 28 forks source link

guard against failure to even choose a test #11

Closed yomimono closed 6 years ago

yomimono commented 6 years ago

If we have a lot of tests, we might need more than one byte of input to even choose which test to run; if given a file with insufficient bytes to run the initial choose, just report that the test was bad and get on with life.

yomimono commented 6 years ago

(you don't even need a lot of tests for this, actually - any test will crash without this patch when invoked on an empty file or /dev/null, that's just less noticeable because AFL won't generate those cases)

stedolan commented 6 years ago

Nice catch!