File: tokener_parse_ex_fuzzer.cc

package info (click to toggle)
json-c 0.15-2%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,512 kB
  • sloc: ansic: 8,166; sh: 493; javascript: 82; makefile: 12; cpp: 11
file content (14 lines) | stat: -rw-r--r-- 337 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdint.h>

#include <json.h>

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
	const char *data1 = reinterpret_cast<const char *>(data);
	json_tokener *tok = json_tokener_new();
	json_object *obj = json_tokener_parse_ex(tok, data1, size);

	json_object_put(obj);
	json_tokener_free(tok);
	return 0;
}