The existing code appears to use 'len_read' in several places where
'total_read' was intended. The function may work if the first 1 or 2
iterations of the loop read the requested 'len' bytes.
If the first two reads are "short" and a third read is done, the bytes
will be placed over previously read bytes in buf and more than 'len'
bytes may be read in total, though buf is never overrun.
This commit changes read_timed to
(1) correctly append short reads in buf
(2) correctly terminate when the sum of the short reads
equals the requested 'len' bytes
(3) return an error when read() returns -1 or 0
The function also depends on select() decrementing the timeout
structure, as it does on Linux. On other platforms, the exec_ms
returned is likely incorrect. This patch does not attempt to address
this issue.
* Make a list of custom mutators using env variable
* Set up multiple custom mutators
* Add destroy custom mutator and changes to load_custom_mutator
* Use array instead of list, make changes to afl-fuzz-one for multiple mutators
* Make change to fuzz-one custom_queue_get to support multiple mutators
* Modify custom python mutator support
* Fix bug
* Fix missing afl->mutator->data
* Revert to list with max count
* Change custom_pre_save hook and code format
* Free custom_mutator struct in the list
* Add testcase for multiple custom mutators
* Resolve merge conflict