]>
git.proxmox.com Git - mirror_ovs.git/blob - tests/oss-fuzz/json_parser_target.c
4 #include "openvswitch/json.h"
5 #include "ovsdb-error.h"
6 #include "ovsdb/table.h"
11 LLVMFuzzerTestOneInput(const uint8_t *data
, size_t size
)
13 if (!size
|| data
[size
- 1]) {
17 struct json
*j1
= json_from_string((const char *)data
);
18 if (j1
->type
== JSON_STRING
) {
23 free(json_to_string(j1
, JSSF_SORT
| JSSF_PRETTY
));
25 struct jsonrpc_msg
*msg
;
26 char *error
= jsonrpc_msg_from_json(j1
, &msg
); /* Frees 'j1'. */
32 struct json
*j2
= jsonrpc_msg_to_json(msg
); /* Frees 'msg'. */
33 if (j2
->type
== JSON_STRING
) {
38 free(json_to_string(j2
, JSSF_SORT
| JSSF_PRETTY
));