/src/jsoncons/fuzzers/fuzz_cbor_parser_max.cpp
Line | Count | Source |
1 | | #include <jsoncons_ext/cbor/cbor.hpp> |
2 | | #include <jsoncons_ext/cbor/cbor_reader.hpp> |
3 | | |
4 | | #include <jsoncons/json.hpp> |
5 | | |
6 | | #include <sstream> |
7 | | |
8 | | using namespace jsoncons; |
9 | | using namespace cbor; |
10 | | |
11 | | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, std::size_t size) |
12 | 35.5k | { |
13 | 35.5k | std::string s(reinterpret_cast<const char*>(data), size); |
14 | 35.5k | std::istringstream is(s); |
15 | | |
16 | 35.5k | default_json_visitor visitor; |
17 | | |
18 | 35.5k | cbor_stream_reader reader(is, visitor); |
19 | 35.5k | std::error_code ec; |
20 | 35.5k | reader.read(ec); |
21 | | |
22 | 35.5k | return 0; |
23 | 35.5k | } |