Add memory bounds to fuzz harnesses, add test for a new crasher #181
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the changes we've made recently, the fuzzer has been running out of memory by discovering very large padding 😂
In this commit, I attempted to fix these fuzzing failures by using the
strftime::io
andstrftime::fmt
variants. Instrftime::fmt
, the fuzzer immediately found a crash.If a multibyte UTF-8 sequence appears immediately following a
%
spec begin marker, the loop to pluck out padding consumes one element from the cursor and then breaks. This leads to pushing a partial UTF-8 character into thefmt::Write
instance, which causes a panic in the underlyingString
because the string's contents is now malformed UTF-8.Add a test and break with
None
if encountering a non-ASCII byte while processing the spec.I've also cleaned up the fuzz targets so they build without warnings.