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