mirror of
https://git.proxmox.com/git/fwupd
synced 2025-07-27 11:09:28 +00:00
trivial: Fix style for fu-fuzzer-firmware.c
This was skipped because pre-commit identified c.in as text not C.
This commit is contained in:
parent
40c7f7ba21
commit
b70d3a73e8
@ -5,32 +5,32 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "@INCLUDE@"
|
||||
|
||||
int
|
||||
LLVMFuzzerTestOneInput (const guint8 *data, gsize size)
|
||||
LLVMFuzzerTestOneInput(const guint8 *data, gsize size)
|
||||
{
|
||||
g_autoptr(FuFirmware) firmware = FU_FIRMWARE (@FIRMWARENEW@ ());
|
||||
g_autoptr(GBytes) fw = g_bytes_new (data, size);
|
||||
g_autoptr(FuFirmware) firmware = FU_FIRMWARE(@FIRMWARENEW@());
|
||||
g_autoptr(GBytes) fw = g_bytes_new(data, size);
|
||||
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 |
|
||||
FWUPD_INSTALL_FLAG_IGNORE_VID_PID |
|
||||
FWUPD_INSTALL_FLAG_IGNORE_CHECKSUM,
|
||||
NULL);
|
||||
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 |
|
||||
FWUPD_INSTALL_FLAG_IGNORE_VID_PID |
|
||||
FWUPD_INSTALL_FLAG_IGNORE_CHECKSUM,
|
||||
NULL);
|
||||
}
|
||||
if (ret) {
|
||||
g_autofree gchar *str = fu_firmware_to_string (firmware);
|
||||
g_autoptr(GBytes) fw2 = fu_firmware_write (firmware, NULL);
|
||||
g_print ("%s", str);
|
||||
if (fw2 != NULL) {
|
||||
g_print ("[%" G_GSIZE_FORMAT " bytes]\n",
|
||||
g_bytes_get_size (fw2));
|
||||
}
|
||||
g_autofree gchar *str = fu_firmware_to_string(firmware);
|
||||
g_autoptr(GBytes) fw2 = fu_firmware_write(firmware, NULL);
|
||||
g_print("%s", str);
|
||||
if (fw2 != NULL)
|
||||
g_print("[%" G_GSIZE_FORMAT " bytes]\n", g_bytes_get_size(fw2));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user