/src/jsoncons/fuzzers/fuzz_msgpack.cpp
Line  | Count  | Source  | 
1  |  | #include <jsoncons_ext/msgpack/msgpack.hpp>  | 
2  |  | #include <jsoncons/json.hpp>  | 
3  |  |  | 
4  |  | #include <sstream>  | 
5  |  | #include <vector>  | 
6  |  | #include <utility>  | 
7  |  | #include <ctime>  | 
8  |  | #include <limits>  | 
9  |  |  | 
10  |  | using namespace jsoncons;  | 
11  |  |  | 
12  |  | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, std::size_t size)  | 
13  | 17.1k  | { | 
14  | 17.1k  |     std::string input(reinterpret_cast<const char*>(data), size);  | 
15  | 17.1k  |     std::istringstream is(input);  | 
16  | 17.1k  |     try { | 
17  | 17.1k  |        json j2 = msgpack::decode_msgpack<json>(is);  | 
18  | 17.1k  |     }  | 
19  | 17.1k  |     catch(const jsoncons::ser_error&) {} | 
20  |  |  | 
21  | 17.1k  |     return 0;  | 
22  | 17.1k  | }  |