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

Function LLVMFuzzerTestOneInput

test/fuzzing/fuzz_uri.cpp:24–52  ·  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 char *data_in = (char *)malloc(size + 1);
32 memcpy(data_in, data, size);
33 data_in[size] = '\0';
34
35
36 std::string input(reinterpret_cast<const char*>(data), size);
37 {
38 brpc::URI uri;
39 uri.SetHttpURL(input);
40 }
41 {
42 butil::StringPiece host;
43 butil::StringPiece vhost;
44 butil::StringPiece port;
45 butil::StringPiece app;
46 butil::StringPiece stream_name;
47
48 brpc::ParseRtmpURL(input, &host, &vhost, &port, &app, &stream_name);
49 }
50
51 return 0;
52}

Callers

nothing calls this directly

Calls 2

ParseRtmpURLFunction · 0.85
SetHttpURLMethod · 0.45

Tested by

no test coverage detected