From add087966d12aea9f8c86b5d1f44c9a0e6908227 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 1 Feb 2023 16:54:47 +0000 Subject: [PATCH] dfu: Clear the buffer before getting the status This makes emulation of DFU devices work as the control transfer data is then predictable. --- plugins/dfu/fu-dfu-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dfu/fu-dfu-device.c b/plugins/dfu/fu-dfu-device.c index f643d3a7f..206ff7d0e 100644 --- a/plugins/dfu/fu-dfu-device.c +++ b/plugins/dfu/fu-dfu-device.c @@ -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);