| 4 | |
| 5 | using namespace jsoncons; |
| 6 | extern "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 | } |