diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2021-04-07 11:02:25 +0200 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2021-04-15 08:19:48 +0200 |
commit | 0c90ff1429deaa556c0509c13cdd5aef5df9c0d4 (patch) | |
tree | 60aaabffdc4c394eb5421c3bfe1d3ab1e4cfcf92 /src/test | |
parent | 5198a02de4e7a1b0efe28c6095745ce59f7f98c4 (diff) | |
download | bitcoin-0c90ff1429deaa556c0509c13cdd5aef5df9c0d4.tar.xz |
fuzz: set errno from FuzzedSock::Wait() if it simulates a failure
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/fuzz/util.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/fuzz/util.cpp b/src/test/fuzz/util.cpp index 2da0e84116..9ab7145b8a 100644 --- a/src/test/fuzz/util.cpp +++ b/src/test/fuzz/util.cpp @@ -9,7 +9,13 @@ 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()) { + SetFuzzedErrNo(m_fuzzed_data_provider, wait_errnos); return false; } if (occurred) *occurred = 0; |