Skip to content

Commit

Permalink
fuzzer: don't remove or modify byte of empty input
Browse files Browse the repository at this point in the history
  • Loading branch information
McSinyx committed Mar 10, 2025
1 parent 8e0a4ca commit bf30d62
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/fuzzer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ const Fuzzer = struct {
while (true) {
const chosen_index = rng.uintLessThanBiased(usize, f.corpus.items.len);
const modification = rng.enumValue(Mutation);
f.mutateAndRunOne(chosen_index, modification);
if (f.corpus.items[chosen_index].bytes.len > 0 or modification == .add_byte)
f.mutateAndRunOne(chosen_index, modification);
}
}

Expand Down

0 comments on commit bf30d62

Please sign in to comment.