MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / FUZZ_TARGET

Function FUZZ_TARGET

src/test/fuzz/string.cpp:49–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47using util::TrimString;
48
49FUZZ_TARGET(string)
50{
51 FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
52 const std::string random_string_1 = fuzzed_data_provider.ConsumeRandomLengthString(32);
53 const std::string random_string_2 = fuzzed_data_provider.ConsumeRandomLengthString(32);
54 const std::vector<std::string> random_string_vector = ConsumeRandomLengthStringVector(fuzzed_data_provider);
55
56 (void)AmountErrMsg(random_string_1, random_string_2);
57 (void)AmountHighWarn(random_string_1);
58 BlockFilterType block_filter_type;
59 (void)BlockFilterTypeByName(random_string_1, block_filter_type);
60 (void)Capitalize(random_string_1);
61 (void)CopyrightHolders(random_string_1);
62 FeeEstimateMode fee_estimate_mode;
63 (void)FeeModeFromString(random_string_1, fee_estimate_mode);
64 const auto width{fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, 1000)};
65 (void)FormatParagraph(random_string_1, width, fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, width));
66 (void)FormatSubVersion(random_string_1, fuzzed_data_provider.ConsumeIntegral<int>(), random_string_vector);
67 (void)HelpExampleCli(random_string_1, random_string_2);
68 (void)HelpExampleRpc(random_string_1, random_string_2);
69 (void)HelpMessageGroup(random_string_1);
70 (void)HelpMessageOpt(random_string_1, "", random_string_2);
71 (void)HelpMessageOpt(random_string_1, random_string_2, "");
72 (void)IsDeprecatedRPCEnabled(random_string_1);
73 (void)Join(random_string_vector, random_string_1);
74 (void)JSONRPCError(fuzzed_data_provider.ConsumeIntegral<int>(), random_string_1);
75 const common::Settings settings;
76 (void)OnlyHasDefaultSectionSetting(settings, random_string_1, random_string_2);
77 (void)ParseNetwork(random_string_1);
78 (void)ParseOutputType(random_string_1);
79 (void)RemovePrefix(random_string_1, random_string_2);
80 (void)ResolveErrMsg(random_string_1, random_string_2);
81 try {
82 (void)RPCConvertNamedValues(random_string_1, random_string_vector);
83 } catch (const std::runtime_error&) {
84 }
85 try {
86 (void)RPCConvertValues(random_string_1, random_string_vector);
87 } catch (const std::runtime_error&) {
88 }
89 (void)SanitizeString(random_string_1);
90 (void)SanitizeString(random_string_1, fuzzed_data_provider.ConsumeIntegralInRange<int>(0, 3));
91#ifndef WIN32
92 (void)ShellEscape(random_string_1);
93#endif // WIN32
94 uint16_t port_out;
95 std::string host_out;
96 SplitHostPort(random_string_1, port_out, host_out);
97 (void)TimingResistantEqual(random_string_1, random_string_2);
98 (void)ToLower(random_string_1);
99 (void)ToUpper(random_string_1);
100 (void)TrimString(random_string_1);
101 (void)TrimString(random_string_1, random_string_2);
102 (void)UrlDecode(random_string_1);
103 (void)ContainsNoNUL(random_string_1);
104 try {
105 throw scriptnum_error{random_string_1};
106 } catch (const std::runtime_error&) {

Callers

nothing calls this directly

Calls 15

AmountErrMsgFunction · 0.85
AmountHighWarnFunction · 0.85
BlockFilterTypeByNameFunction · 0.85
CapitalizeFunction · 0.85
CopyrightHoldersFunction · 0.85
FeeModeFromStringFunction · 0.85
FormatParagraphFunction · 0.85
FormatSubVersionFunction · 0.85
HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
HelpMessageGroupFunction · 0.85

Tested by

no test coverage detected