diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-03-24 14:25:39 +0100 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-04-04 12:33:49 +0200 |
commit | fa454dcb20b9e7943cc25e6eeea72912b5f1c7b5 (patch) | |
tree | 8d93fcb527f926e5b4f2178e86929c3a33032f7d /src/test/fuzz/socks5.cpp | |
parent | 5150e280103dd41c8a438ce72359b0f25ff23a2f (diff) | |
download | bitcoin-fa454dcb20b9e7943cc25e6eeea72912b5f1c7b5.tar.xz |
net: Use steady clock in InterruptibleRecv
Diffstat (limited to 'src/test/fuzz/socks5.cpp')
-rw-r--r-- | src/test/fuzz/socks5.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/fuzz/socks5.cpp b/src/test/fuzz/socks5.cpp index 97f643db49..73235b7ced 100644 --- a/src/test/fuzz/socks5.cpp +++ b/src/test/fuzz/socks5.cpp @@ -14,12 +14,12 @@ #include <string> #include <vector> +extern std::chrono::milliseconds g_socks5_recv_timeout; + namespace { -int default_socks5_recv_timeout; +decltype(g_socks5_recv_timeout) default_socks5_recv_timeout; }; -extern int g_socks5_recv_timeout; - void initialize_socks5() { static const auto testing_setup = MakeNoLogFileContext<const BasicTestingSetup>(); @@ -35,7 +35,7 @@ FUZZ_TARGET_INIT(socks5, initialize_socks5) InterruptSocks5(fuzzed_data_provider.ConsumeBool()); // Set FUZZED_SOCKET_FAKE_LATENCY=1 to exercise recv timeout code paths. This // will slow down fuzzing. - g_socks5_recv_timeout = (fuzzed_data_provider.ConsumeBool() && std::getenv("FUZZED_SOCKET_FAKE_LATENCY") != nullptr) ? 1 : default_socks5_recv_timeout; + g_socks5_recv_timeout = (fuzzed_data_provider.ConsumeBool() && std::getenv("FUZZED_SOCKET_FAKE_LATENCY") != nullptr) ? 1ms : default_socks5_recv_timeout; FuzzedSock fuzzed_sock = ConsumeSock(fuzzed_data_provider); // This Socks5(...) fuzzing harness would have caught CVE-2017-18350 within // a few seconds of fuzzing. |