]> git.proxmox.com Git - fwupd.git/commitdiff
dfu: Clear the buffer before getting the status
authorRichard Hughes <richard@hughsie.com>
Wed, 1 Feb 2023 16:54:47 +0000 (16:54 +0000)
committerRichard Hughes <richard@hughsie.com>
Wed, 1 Feb 2023 18:20:26 +0000 (18:20 +0000)
This makes emulation of DFU devices work as the control transfer data is then
predictable.

plugins/dfu/fu-dfu-device.c

index f643d3a7f53f79a832322e6a4df046660864fb80..206ff7d0ed020fbe2b591cacb09efc65f1846bad 100644 (file)
@@ -725,7 +725,7 @@ fu_dfu_device_refresh(FuDfuDevice *self, GError **error)
        FuDfuDevicePrivate *priv = GET_PRIVATE(self);
        GUsbDevice *usb_device = fu_usb_device_get_dev(FU_USB_DEVICE(self));
        gsize actual_length = 0;
-       guint8 buf[6];
+       guint8 buf[6] = {0x0};
        g_autoptr(GError) error_local = NULL;
 
        g_return_val_if_fail(FU_IS_DFU_DEVICE(self), FALSE);