2018-10-11 02:02:03 +02:00
|
|
|
#include "gio/gio.h"
|
|
|
|
#include "glib/glib.h"
|
|
|
|
|
|
|
|
int LLVMFuzzerTestOneInput (const unsigned char *data, size_t size);
|
|
|
|
|
|
|
|
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
|
|
|
static GLogWriterOutput
|
|
|
|
empty_logging_func (GLogLevelFlags log_level, const GLogField *fields,
|
|
|
|
gsize n_fields, gpointer user_data)
|
|
|
|
{
|
|
|
|
return G_LOG_WRITER_HANDLED;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Disables logging for oss-fuzz. Must be used with each target. */
|
|
|
|
static void
|
|
|
|
fuzz_set_logging_func (void)
|
|
|
|
{
|
|
|
|
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
2022-05-05 17:32:27 +02:00
|
|
|
static gboolean writer_set = FALSE;
|
|
|
|
|
|
|
|
if (!writer_set)
|
|
|
|
{
|
|
|
|
g_log_set_writer_func (empty_logging_func, NULL, NULL);
|
|
|
|
writer_set = TRUE;
|
|
|
|
}
|
2018-10-11 02:02:03 +02:00
|
|
|
#endif
|
|
|
|
}
|