MCPcopy Create free account
hub / github.com/apache/brpc / LLVMFuzzerTestOneInput

Function LLVMFuzzerTestOneInput

test/fuzzing/fuzz_butil.cpp:26–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#define kMaxInputLength 1024
25
26extern "C" int
27LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
28{
29 if (size < kMinInputLength || size > kMaxInputLength){
30 return 1;
31 }
32
33 std::string input(reinterpret_cast<const char*>(data), size);
34
35 {
36 std::string encoded;
37 std::string decoded;
38 butil::Base64Encode(input, &encoded);
39 butil::Base64Decode(input, &decoded);
40 }
41 {
42 butil::crc32c::Value(reinterpret_cast<const char*>(data), size);
43 }
44 {
45 butil::Hash(input);
46 }
47 {
48 butil::SHA1HashString(input);
49 }
50
51 return 0;
52}

Callers

nothing calls this directly

Calls 5

Base64EncodeFunction · 0.85
Base64DecodeFunction · 0.85
SHA1HashStringFunction · 0.85
ValueClass · 0.50
HashFunction · 0.50

Tested by

no test coverage detected