fuzzing: Only set the writer function once

This should fix fuzzing builds since commit dfb3517d.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

oss-fuzz#47108
This commit is contained in:
Philip Withnall 2022-05-05 16:32:27 +01:00
parent fa5947d3e7
commit 70e7161bc5

View File

@ -17,6 +17,12 @@ static void
fuzz_set_logging_func (void)
{
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
g_log_set_writer_func (empty_logging_func, NULL, NULL);
static gboolean writer_set = FALSE;
if (!writer_set)
{
g_log_set_writer_func (empty_logging_func, NULL, NULL);
writer_set = TRUE;
}
#endif
}