Skip to content

Commit 865cdf3

Browse files
committed
[fuzz] Use fuzzer friendly ConsumeRandomLengthByteVector in FuzzedSock::Recv
See comment on FuzzedDataProvider::ConsumeRandomLengthString.
1 parent 6f36624 commit 865cdf3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/test/fuzz/util/net.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ ssize_t FuzzedSock::Recv(void* buf, size_t len, int flags) const
206206
pad_to_len_bytes = false;
207207
}
208208
} else {
209-
random_bytes = m_fuzzed_data_provider.ConsumeBytes<uint8_t>(
210-
m_fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, len));
209+
random_bytes = ConsumeRandomLengthByteVector(m_fuzzed_data_provider, len);
211210
}
212211
if (random_bytes.empty()) {
213212
const ssize_t r = m_fuzzed_data_provider.ConsumeBool() ? 0 : -1;

0 commit comments

Comments
 (0)