| 4 | #include <util/stream/str.h> |
| 5 | |
| 6 | extern "C" int LLVMFuzzerTestOneInput(const ui8* data, size_t size) { |
| 7 | const auto json = TString((const char*)data, size); |
| 8 | |
| 9 | try { |
| 10 | NJson::TJsonValue value; |
| 11 | NJson::ReadJsonFastTree(json, &value, true); |
| 12 | } catch (...) { |
| 13 | // Cout << json << " -> " << CurrentExceptionMessage() << Endl; |
| 14 | } |
| 15 | |
| 16 | try { |
| 17 | NJson::TJsonCallbacks cb; |
| 18 | NJson::ReadJsonFast(json, &cb); |
| 19 | } catch (...) { |
| 20 | // Cout << json << " -> " << CurrentExceptionMessage() << Endl; |
| 21 | } |
| 22 | |
| 23 | try { |
| 24 | NJson::ValidateJson(json); |
| 25 | } catch (...) { |
| 26 | // Cout << json << " -> " << CurrentExceptionMessage() << Endl; |
| 27 | } |
| 28 | |
| 29 | return 0; |
| 30 | } |
nothing calls this directly
no test coverage detected