MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / LLVMFuzzerTestOneInput

Function LLVMFuzzerTestOneInput

fuzzers/fuzz_csv.cpp:9–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8using namespace jsoncons;
9extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, std::size_t size)
10{
11 std::string input(reinterpret_cast<const char*>(data), size);
12 json_decoder<ojson> decoder;
13 auto options = csv::csv_options{}
14 .assume_header(true)
15 .mapping_kind(csv::csv_mapping_kind::n_rows);
16 try {
17 csv::csv_string_reader reader1(input, decoder, options);
18 reader1.read();
19 }
20 catch (jsoncons::ser_error e) {}
21 catch (jsoncons::json_runtime_error<std::runtime_error> e) {}
22 catch (json_runtime_error<std::invalid_argument> e3) {}
23 return 0;
24}

Callers

nothing calls this directly

Calls 3

mapping_kindMethod · 0.80
assume_headerMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected