1 #include <inttypes.h> 2 #include <stddef.h> 3 #include <stdlib.h> 4 #include <string.h> 5 6 #include <xen/libelf/libelf.h> 7 LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)8int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 9 { 10 struct elf_binary elf_buf, *elf; 11 struct elf_dom_parms parms; 12 13 elf = &elf_buf; 14 15 memset(elf, 0, sizeof(*elf)); 16 if ( elf_init(elf, (const char *)data, size) < 0 ) 17 return -1; 18 19 elf_parse_binary(elf); 20 elf_xen_parse(elf, &parms); 21 22 return 0; 23 } 24 25 26 /* 27 * Local variables: 28 * mode: C 29 * c-file-style: "BSD" 30 * c-basic-offset: 4 31 * tab-width: 4 32 * indent-tabs-mode: nil 33 * End: 34 */ 35