MCPcopy Create free account
hub / github.com/catboost/catboost / LLVMFuzzerTestOneInput

Function LLVMFuzzerTestOneInput

library/cpp/json/fuzzy_test/main.cpp:6–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <util/stream/str.h>
5
6extern "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}

Callers

nothing calls this directly

Calls 2

ReadJsonFastTreeFunction · 0.50
ValidateJsonFunction · 0.50

Tested by

no test coverage detected