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

Function LLVMFuzzerTestOneInput

test/fuzzing/fuzz_redis.cpp:24–47  ·  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 butil::IOBuf buf;
33 buf.append(input);
34 {
35 butil::Arena arena;
36 brpc::RedisCommandParser parser;
37 std::vector<butil::StringPiece> command_out;
38 parser.Consume(buf, &command_out, &arena);
39 }
40 {
41 butil::Arena arena;
42 brpc::RedisReply r2(&arena);
43 r2.ConsumePartialIOBuf(buf);
44 }
45
46 return 0;
47}
48

Callers

nothing calls this directly

Calls 3

appendMethod · 0.45
ConsumeMethod · 0.45
ConsumePartialIOBufMethod · 0.45

Tested by

no test coverage detected