Skip to content

Commit 0c90ff1

Browse files
committed
fuzz: set errno from FuzzedSock::Wait() if it simulates a failure
1 parent 5198a02 commit 0c90ff1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/fuzz/util.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99

1010
bool FuzzedSock::Wait(std::chrono::milliseconds timeout, Event requested, Event* occurred) const
1111
{
12+
constexpr std::array wait_errnos{
13+
EBADF,
14+
EINTR,
15+
EINVAL,
16+
};
1217
if (!m_fuzzed_data_provider.ConsumeBool()) {
18+
SetFuzzedErrNo(m_fuzzed_data_provider, wait_errnos);
1319
return false;
1420
}
1521
if (occurred) *occurred = 0;

0 commit comments

Comments
 (0)