mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
[fuzz] Use fuzzer friendly ConsumeRandomLengthByteVector in FuzzedSock::Recv
See comment on FuzzedDataProvider::ConsumeRandomLengthString.
This commit is contained in:
parent
6f36624147
commit
865cdf3692
1 changed files with 1 additions and 2 deletions
|
@ -206,8 +206,7 @@ ssize_t FuzzedSock::Recv(void* buf, size_t len, int flags) const
|
|||
pad_to_len_bytes = false;
|
||||
}
|
||||
} else {
|
||||
random_bytes = m_fuzzed_data_provider.ConsumeBytes<uint8_t>(
|
||||
m_fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, len));
|
||||
random_bytes = ConsumeRandomLengthByteVector(m_fuzzed_data_provider, len);
|
||||
}
|
||||
if (random_bytes.empty()) {
|
||||
const ssize_t r = m_fuzzed_data_provider.ConsumeBool() ? 0 : -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue