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

Function LLVMFuzzerTestOneInput

test/fuzzing/fuzz_shead.cpp:25–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

get_fuzz_socketFunction · 0.85
ParseNsheadMessageFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected