1 #include "gio/gio.h" 2 #include "glib/glib.h" 3 4 int LLVMFuzzerTestOneInput (const unsigned char *data, size_t size); 5 6 #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION 7 static GLogWriterOutput empty_logging_func(GLogLevelFlags log_level,const GLogField * fields,gsize n_fields,gpointer user_data)8empty_logging_func (GLogLevelFlags log_level, const GLogField *fields, 9 gsize n_fields, gpointer user_data) 10 { 11 return G_LOG_WRITER_HANDLED; 12 } 13 #endif 14 15 /* Disables logging for oss-fuzz. Must be used with each target. */ 16 static void fuzz_set_logging_func(void)17fuzz_set_logging_func (void) 18 { 19 #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION 20 g_log_set_writer_func (empty_logging_func, NULL, NULL); 21 #endif 22 } 23