mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-25 08:41:11 +02:00
fuzz: set errno from FuzzedSock::Wait() if it simulates a failure
This commit is contained in:
@@ -9,7 +9,13 @@
|
|||||||
|
|
||||||
bool FuzzedSock::Wait(std::chrono::milliseconds timeout, Event requested, Event* occurred) const
|
bool FuzzedSock::Wait(std::chrono::milliseconds timeout, Event requested, Event* occurred) const
|
||||||
{
|
{
|
||||||
|
constexpr std::array wait_errnos{
|
||||||
|
EBADF,
|
||||||
|
EINTR,
|
||||||
|
EINVAL,
|
||||||
|
};
|
||||||
if (!m_fuzzed_data_provider.ConsumeBool()) {
|
if (!m_fuzzed_data_provider.ConsumeBool()) {
|
||||||
|
SetFuzzedErrNo(m_fuzzed_data_provider, wait_errnos);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (occurred) *occurred = 0;
|
if (occurred) *occurred = 0;
|
||||||
|
Reference in New Issue
Block a user