1*a0409676SBaptiste Daroussin #include <stdio.h> 2*a0409676SBaptiste Daroussin #include <errno.h> 3*a0409676SBaptiste Daroussin #include <unistd.h> 4*a0409676SBaptiste Daroussin #include "ucl.h" 5*a0409676SBaptiste Daroussin #include "ucl_internal.h" 6*a0409676SBaptiste Daroussin #include <ctype.h> 7*a0409676SBaptiste Daroussin 8*a0409676SBaptiste Daroussin typedef ucl_object_t* (*ucl_msgpack_test)(void); 9*a0409676SBaptiste Daroussin 10*a0409676SBaptiste Daroussin LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)11*a0409676SBaptiste Daroussinint LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { 12*a0409676SBaptiste Daroussin 13*a0409676SBaptiste Daroussin if(size<3){ 14*a0409676SBaptiste Daroussin return 0; 15*a0409676SBaptiste Daroussin } 16*a0409676SBaptiste Daroussin 17*a0409676SBaptiste Daroussin struct ucl_parser *parser; 18*a0409676SBaptiste Daroussin 19*a0409676SBaptiste Daroussin ucl_object_t *obj = ucl_object_new_full (UCL_OBJECT, 2); 20*a0409676SBaptiste Daroussin obj->type = UCL_OBJECT; 21*a0409676SBaptiste Daroussin 22*a0409676SBaptiste Daroussin parser = ucl_parser_new(UCL_PARSER_KEY_LOWERCASE); 23*a0409676SBaptiste Daroussin parser->stack = NULL; 24*a0409676SBaptiste Daroussin 25*a0409676SBaptiste Daroussin bool res = ucl_parser_add_chunk_full(parser, (const unsigned char*)data, size, 0, UCL_DUPLICATE_APPEND, UCL_PARSE_MSGPACK); 26*a0409676SBaptiste Daroussin 27*a0409676SBaptiste Daroussin ucl_parser_free (parser); 28*a0409676SBaptiste Daroussin return 0; 29*a0409676SBaptiste Daroussin } 30