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

Function LLVMFuzzerTestOneInput

test/fuzzing/fuzz_sofa.cpp:26–41  ·  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 butil::IOBuf buf;
36 buf.append(input);
37
38 brpc::Socket* sock = get_fuzz_socket();
39 brpc::policy::ParseSofaMessage(&buf, sock, false, NULL);
40 return 0;
41}

Callers

nothing calls this directly

Calls 3

get_fuzz_socketFunction · 0.85
ParseSofaMessageFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected