1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00

[libFuzzer] don't create large random mutations when given an empty seed

llvm-svn: 290634
This commit is contained in:
Kostya Serebryany 2016-12-27 22:15:04 +00:00
parent aece9ad2f5
commit b6d58e94d4

View File

@ -486,7 +486,7 @@ size_t MutationDispatcher::MutateImpl(uint8_t *Data, size_t Size,
const std::vector<Mutator> &Mutators) {
assert(MaxSize > 0);
if (Size == 0) {
for (size_t i = 0; i < MaxSize; i++)
for (size_t i = 0; i < Min(size_t(4), MaxSize); i++)
Data[i] = RandCh(Rand);
if (Options.OnlyASCII)
ToASCII(Data, MaxSize);