diff options
Diffstat (limited to 'src/test/fuzz/crypto.cpp')
-rw-r--r-- | src/test/fuzz/crypto.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/test/fuzz/crypto.cpp b/src/test/fuzz/crypto.cpp index ca8c1cd033..aa478277e3 100644 --- a/src/test/fuzz/crypto.cpp +++ b/src/test/fuzz/crypto.cpp @@ -22,7 +22,9 @@ FUZZ_TARGET(crypto) FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()}; std::vector<uint8_t> data = ConsumeRandomLengthByteVector(fuzzed_data_provider); if (data.empty()) { - data.resize(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, 4096), fuzzed_data_provider.ConsumeIntegral<uint8_t>()); + auto new_size = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, 4096); + auto x = fuzzed_data_provider.ConsumeIntegral<uint8_t>(); + data.resize(new_size, x); } CHash160 hash160; @@ -44,7 +46,9 @@ FUZZ_TARGET(crypto) if (fuzzed_data_provider.ConsumeBool()) { data = ConsumeRandomLengthByteVector(fuzzed_data_provider); if (data.empty()) { - data.resize(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, 4096), fuzzed_data_provider.ConsumeIntegral<uint8_t>()); + auto new_size = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, 4096); + auto x = fuzzed_data_provider.ConsumeIntegral<uint8_t>(); + data.resize(new_size, x); } } |