trivial: Crash the fuzzer on critical warning

We want to abort early rather than relying on other problems like segfault or OOM.
This commit is contained in:
Richard Hughes 2021-11-17 14:49:18 +00:00
parent b9024e80ae
commit fedce9e077

View File

@ -12,7 +12,10 @@ LLVMFuzzerTestOneInput (const guint8 *data, gsize size)
{
g_autoptr(FuFirmware) firmware = FU_FIRMWARE (@FIRMWARENEW@ ());
g_autoptr(GBytes) fw = g_bytes_new (data, size);
gboolean ret = fu_firmware_parse (firmware, fw, FWUPD_INSTALL_FLAG_NONE, NULL);
gboolean ret;
g_setenv("G_DEBUG", "fatal-criticals", FALSE);
ret = fu_firmware_parse (firmware, fw, FWUPD_INSTALL_FLAG_NONE, NULL);
if (!ret && fu_firmware_has_flag (firmware, FU_FIRMWARE_FLAG_HAS_CHECKSUM)) {
ret = fu_firmware_parse (firmware, fw,
FWUPD_INSTALL_FLAG_NO_SEARCH |