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

Function LLVMFuzzerTestOneInput

test/fuzzing/fuzz_baidu_rpc.cpp:24–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22#define kMaxInputLength 4096
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 butil::IOBuf buf;
33 buf.append(input);
34
35 brpc::Socket* sock = get_fuzz_socket();
36 brpc::policy::ParseRpcMessage(&buf, sock, false, NULL);
37 return 0;
38}

Callers

nothing calls this directly

Calls 3

get_fuzz_socketFunction · 0.85
ParseRpcMessageFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected