From 12ea11632b8e85eea2a4c74d34f8ffd293141309 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 1 Nov 2017 08:50:25 +0100 Subject: [PATCH] fuzzer: Make critical warnings fatal --- fuzzing/gst-discoverer.c | 5 ++--- fuzzing/typefind.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/fuzzing/gst-discoverer.c b/fuzzing/gst-discoverer.c index 1f862aaa95..21ed67b552 100644 --- a/fuzzing/gst-discoverer.c +++ b/fuzzing/gst-discoverer.c @@ -77,9 +77,8 @@ int LLVMFuzzerTestOneInput(const guint8 *data, size_t size) static gboolean initialized = 0; if (!initialized) { - /* We want critical warnings to assert so we can fix them - * But somehow it's not causing oss-fuzz to crash ... */ - g_setenv ("G_DEBUG", "fatal-criticals", TRUE); + /* We want critical warnings to assert so we can fix them */ + g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL); /* Only initialize and register plugins once */ gst_init (NULL, NULL); diff --git a/fuzzing/typefind.c b/fuzzing/typefind.c index 780a4a9010..fd80148c24 100644 --- a/fuzzing/typefind.c +++ b/fuzzing/typefind.c @@ -53,9 +53,8 @@ LLVMFuzzerTestOneInput (const guint8 * data, size_t size) GstState state; if (!initialized) { - /* We want critical warnings to assert so we can fix them - * But somehow it's not causing oss-fuzz to crash ... */ - g_setenv ("G_DEBUG", "fatal-criticals", TRUE); + /* We want critical warnings to assert so we can fix them */ + g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL); /* Only initialize and register plugins once */ gst_init (NULL, NULL);