Blame SOURCES/0008-wacom-usb-Fix-a-crash-detected-by-AddressSanitizer.patch

9874f4
From b943adc496451975a9b959d78c0859a7fea5e483 Mon Sep 17 00:00:00 2001
9874f4
From: Richard Hughes <richard@hughsie.com>
9874f4
Date: Sun, 7 Feb 2021 16:55:02 +0000
9874f4
Subject: [PATCH 08/11] wacom-usb: Fix a crash detected by AddressSanitizer
9874f4
9874f4
---
9874f4
 plugins/wacom-usb/fu-wac-firmware.c | 2 +-
9874f4
 1 file changed, 1 insertion(+), 1 deletion(-)
9874f4
9874f4
diff --git plugins/wacom-usb/fu-wac-firmware.c plugins/wacom-usb/fu-wac-firmware.c
9874f4
index fc54cf10..d3a41682 100644
9874f4
--- plugins/wacom-usb/fu-wac-firmware.c
9874f4
+++ plugins/wacom-usb/fu-wac-firmware.c
9874f4
@@ -44,7 +44,7 @@ fu_wac_firmware_parse (FuFirmware *firmware,
9874f4
 
9874f4
 	/* check the prefix (BE) */
9874f4
 	data = (guint8 *) g_bytes_get_data (fw, &len;;
9874f4
-	if (memcmp (data, "WACOM", 5) != 0) {
9874f4
+	if (len < 5 || memcmp (data, "WACOM", 5) != 0) {
9874f4
 		g_set_error_literal (error,
9874f4
 				     FWUPD_ERROR,
9874f4
 				     FWUPD_ERROR_INTERNAL,
9874f4
-- 
9874f4
2.29.2
9874f4