1 #include <assert.h> 2 #include "libcper/cper-parse.h" 3 #include "test-utils.h" 4 5 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 6 { 7 json_object *ir = cper_buf_to_ir(data, size); 8 if (ir == NULL) { 9 return 0; 10 } 11 12 int valid = schema_validate_from_file(ir, 0 /* single_section */, 13 /*all_valid_bits*/ 0); 14 if (!valid) { 15 printf("JSON: %s\n", json_object_to_json_string(ir)); 16 } 17 assert(valid); 18 json_object_put(ir); 19 20 return 0; 21 } 22