File: fuzz_parse.cpp

package info (click to toggle)
jsoncons 1.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,300 kB
  • sloc: cpp: 143,266; sh: 34; makefile: 8
file content (15 lines) | stat: -rw-r--r-- 330 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <jsoncons/json_parser.hpp>
#include <jsoncons/json.hpp>

using namespace jsoncons;

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, std::size_t size) 
{
	std::string input(reinterpret_cast<const char*>(data), size);
	try{
		json val = json::parse(input);
	}
	catch(const jsoncons::ser_error&) {}

	return 0;
}