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

Function LLVMFuzzerTestOneInput

tests/fuzzing/fuzz_esi.cc:30–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28#define kMaxInputLength 1024
29
30extern "C" int
31LLVMFuzzerTestOneInput(const uint8_t *input_data, size_t size_data)
32{
33 if (size_data < kMinInputLength || size_data > kMaxInputLength) {
34 return 1;
35 }
36
37 std::string input(reinterpret_cast<const char *>(input_data), size_data);
38
39 EsiParser parser{1024 * 1024};
40
41 EsiLib::DocNodeList node_list;
42 bool ret = parser.completeParse(node_list, input);
43
44 if (ret == true) {
45 EsiLib::DocNodeList node_list2;
46 std::string packed = node_list.pack();
47 node_list2.unpack(packed);
48 node_list2.clear();
49 }
50 node_list.clear();
51
52 return 0;
53}

Callers

nothing calls this directly

Calls 4

completeParseMethod · 0.45
packMethod · 0.45
unpackMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected