trivial: Make fuzzing less verbose

This commit is contained in:
Richard Hughes 2022-07-25 16:19:40 +01:00
parent 9188060ce2
commit 66532a1293
4 changed files with 6 additions and 2 deletions

View File

@ -18,6 +18,7 @@ with a non-standard filesystem layout.
* `FWUPD_DBUS_SOCKET` is used to set the socket filename if running without a dbus-daemon
* `FWUPD_DOWNLOAD_VERBOSE` can be used to show wget or curl output
* `FWUPD_PROFILE` can be used to set the profile traceback threshold value in ms
* `FWUPD_FUZZER_RUNNING` if the firmware format is being fuzzed
* standard glibc variables like `LANG` are also honored for CLI tools that are translated
* libcurl respects the session proxy, e.g. `http_proxy`, `all_proxy`, `sftp_proxy` and `no_proxy`

View File

@ -16,6 +16,7 @@ LLVMFuzzerTestOneInput(const guint8 *data, gsize size)
gboolean ret;
(void)g_setenv("G_DEBUG", "fatal-criticals", FALSE);
(void)g_setenv("FWUPD_FUZZER_RUNNING", "1", TRUE);
ret = fu_firmware_parse(firmware, fw, FWUPD_INSTALL_FLAG_NONE, NULL);
if (!ret && fu_firmware_has_flag(firmware, FU_FIRMWARE_FLAG_HAS_CHECKSUM)) {
g_clear_object(&firmware);

View File

@ -117,7 +117,8 @@ fu_bcm57xx_dict_image_ensure_id(FuBcm57xxDictImage *self)
}
}
id = g_strdup_printf("dict-%02x-%02x", self->target, self->kind);
g_warning("falling back to %s, please report", id);
if (g_getenv("FWUPD_FUZZER_RUNNING") == NULL)
g_warning("falling back to %s, please report", id);
fu_firmware_set_id(FU_FIRMWARE(self), id);
}

View File

@ -198,7 +198,8 @@ fu_uf2_firmware_parse_chunk(FuUf2Firmware *self, FuChunk *chk, GByteArray *tmp,
return FALSE;
fu_firmware_set_id(FU_FIRMWARE(self), utf8buf);
} else {
g_warning("unknown tag 0x%06x", tag);
if (g_getenv("FWUPD_FUZZER_RUNNING") == NULL)
g_warning("unknown tag 0x%06x", tag);
}
/* next! */