diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-05-11 21:27:37 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-05-11 21:24:49 +0200 |
commit | faa0d94a7d9cdd10e81ee231a7b06d4b14b37e13 (patch) | |
tree | 435a38ff12e7cf920e4a5cb53932d3ab6de0ec8d | |
parent | f0a76b3dbc649d122bf9acc66390fd457ed1602a (diff) | |
download | bitcoin-faa0d94a7d9cdd10e81ee231a7b06d4b14b37e13.tar.xz |
fuzz: Avoid timeout in EncodeBase58
-rw-r--r-- | src/test/fuzz/rpc.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/fuzz/rpc.cpp b/src/test/fuzz/rpc.cpp index cf32a79932..9195cc4873 100644 --- a/src/test/fuzz/rpc.cpp +++ b/src/test/fuzz/rpc.cpp @@ -168,6 +168,7 @@ const std::vector<std::string> RPC_COMMANDS_SAFE_FOR_FUZZING{ std::string ConsumeScalarRPCArgument(FuzzedDataProvider& fuzzed_data_provider) { const size_t max_string_length = 4096; + const size_t max_base58_bytes_length{64}; std::string r; CallOneOf( fuzzed_data_provider, @@ -221,11 +222,11 @@ std::string ConsumeScalarRPCArgument(FuzzedDataProvider& fuzzed_data_provider) }, [&] { // base58 argument - r = EncodeBase58(MakeUCharSpan(fuzzed_data_provider.ConsumeRandomLengthString(max_string_length))); + r = EncodeBase58(MakeUCharSpan(fuzzed_data_provider.ConsumeRandomLengthString(max_base58_bytes_length))); }, [&] { // base58 argument with checksum - r = EncodeBase58Check(MakeUCharSpan(fuzzed_data_provider.ConsumeRandomLengthString(max_string_length))); + r = EncodeBase58Check(MakeUCharSpan(fuzzed_data_provider.ConsumeRandomLengthString(max_base58_bytes_length))); }, [&] { // hex encoded block |