MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / LLVMFuzzerTestOneInput

Function LLVMFuzzerTestOneInput

fuzzers/fuzz_json_cursor.cpp:6–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5using namespace jsoncons;
6extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, std::size_t size)
7{
8 std::string s(reinterpret_cast<const char*>(data), size);
9 std::istringstream is(s);
10
11 std::error_code ec;
12 json_stream_cursor reader(is, ec);
13 while (!reader.done() && !ec)
14 {
15 const auto& event = reader.current();
16 std::string s2 = event.get<std::string>(ec);
17 if (!ec)
18 {
19 reader.next(ec);
20 }
21 }
22
23 return 0;
24}

Callers

nothing calls this directly

Calls 3

currentMethod · 0.80
doneMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected