diff options
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. |