1 #include "fuzz.h" 2 3 int LLVMFuzzerTestOneInput(const unsigned char * data,size_t size)4LLVMFuzzerTestOneInput (const unsigned char *data, size_t size) 5 { 6 unsigned char *nul_terminated_data = NULL; 7 GDate *date = g_date_new (); 8 9 fuzz_set_logging_func (); 10 11 /* ignore @size (g_date_set_parse() doesn’t support it); ensure @data is nul-terminated */ 12 nul_terminated_data = (unsigned char *) g_strndup ((const gchar *) data, size); 13 g_date_set_parse (date, (const gchar *) nul_terminated_data); 14 g_free (nul_terminated_data); 15 16 g_date_free (date); 17 18 return 0; 19 } 20