1 #include "fuzz.h"
2
3 static void
test_parse(const gchar * data,size_t size,GKeyFileFlags flags)4 test_parse (const gchar *data,
5 size_t size,
6 GKeyFileFlags flags)
7 {
8 GKeyFile *key = NULL;
9
10 key = g_key_file_new ();
11 g_key_file_load_from_data (key, (const gchar*) data, size, G_KEY_FILE_NONE,
12 NULL);
13
14 g_key_file_free (key);
15 }
16
17 int
LLVMFuzzerTestOneInput(const unsigned char * data,size_t size)18 LLVMFuzzerTestOneInput (const unsigned char *data, size_t size)
19 {
20 fuzz_set_logging_func ();
21
22 test_parse ((const gchar *) data, size, G_KEY_FILE_NONE);
23 test_parse ((const gchar *) data, size, G_KEY_FILE_KEEP_COMMENTS);
24 test_parse ((const gchar *) data, size, G_KEY_FILE_KEEP_TRANSLATIONS);
25
26 return 0;
27 }
28