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

Function LLVMFuzzerTestOneInput

test/fuzzing/fuzz_esp.cpp:24–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22#define kMaxInputLength 1024
23
24extern "C" int
25LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
26{
27 if (size < kMinInputLength || size > kMaxInputLength){
28 return 1;
29 }
30
31 std::string input(reinterpret_cast<const char*>(data), size);
32
33 butil::IOBuf buf;
34 buf.append(input);
35
36 brpc::Socket* sock = get_fuzz_socket();
37 brpc::policy::ParseEspMessage(&buf, sock, false, NULL);
38
39 return 0;
40}

Callers

nothing calls this directly

Calls 3

get_fuzz_socketFunction · 0.85
ParseEspMessageFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected