MCPcopy Create free account
hub / github.com/CrowCpp/Crow / LLVMFuzzerTestOneInput

Function LLVMFuzzerTestOneInput

tests/fuzz/b64_fuzzer.cpp:14–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12};
13
14extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t* data, const std::size_t size)
15{
16 FuzzedDataProvider fdp{data, size};
17
18 std::string plaintext = fdp.ConsumeRandomLengthString();
19 std::string encoded = crow::utility::base64encode(plaintext, plaintext.size());
20 std::string decoded = crow::utility::base64decode(encoded, encoded.size());
21
22 if (plaintext != decoded)
23 {
24 throw FuzzException();
25 }
26 return 0;
27}

Callers

nothing calls this directly

Calls 4

base64encodeFunction · 0.85
base64decodeFunction · 0.85
FuzzExceptionClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected