aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/util
diff options
context:
space:
mode:
authordergoegge <n.goeggi@gmail.com>2024-05-31 14:26:28 +0100
committerdergoegge <n.goeggi@gmail.com>2024-05-31 14:48:29 +0100
commit865cdf3692590bc6b1121524fe1bee188788b791 (patch)
treefb39dd394b0ab1c24b998bbe22e39b4a07a4e358 /src/test/fuzz/util
parent6f36624147dfb59603698db647b4ad612b771810 (diff)
[fuzz] Use fuzzer friendly ConsumeRandomLengthByteVector in FuzzedSock::Recv
See comment on FuzzedDataProvider::ConsumeRandomLengthString.
Diffstat (limited to 'src/test/fuzz/util')
-rw-r--r--src/test/fuzz/util/net.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/test/fuzz/util/net.cpp b/src/test/fuzz/util/net.cpp
index 99151bb84d..167795e423 100644
--- a/src/test/fuzz/util/net.cpp
+++ b/src/test/fuzz/util/net.cpp
@@ -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;