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

Function LLVMFuzzerTestOneInput

test/fuzzing/fuzz_http.cpp:24–45  ·  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 {
34 butil::IOBuf buf;
35 buf.append(input);
36 brpc::HttpMessage http_message;
37 http_message.ParseFromIOBuf(buf);
38 }
39 {
40 brpc::HttpMessage http_message;
41 http_message.ParseFromArray((char *)data, size);
42 }
43
44 return 0;
45}

Callers

nothing calls this directly

Calls 3

ParseFromIOBufMethod · 0.80
ParseFromArrayMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected