1 | #include "fuzz.h" |
2 | |
3 | static void |
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_file: key, data: (const gchar*) data, length: size, flags: G_KEY_FILE_NONE, |
12 | NULL); |
13 | |
14 | g_key_file_free (key_file: key); |
15 | } |
16 | |
17 | int |
18 | LLVMFuzzerTestOneInput (const unsigned char *data, size_t size) |
19 | { |
20 | fuzz_set_logging_func (); |
21 | |
22 | test_parse (data: (const gchar *) data, size, flags: G_KEY_FILE_NONE); |
23 | test_parse (data: (const gchar *) data, size, flags: G_KEY_FILE_KEEP_COMMENTS); |
24 | test_parse (data: (const gchar *) data, size, flags: G_KEY_FILE_KEEP_TRANSLATIONS); |
25 | |
26 | return 0; |
27 | } |
28 | |