Blame SOURCES/0011-wacom-usb-Fix-a-buffer-overread-spotted-by-AddressSa.patch

9874f4
From 60b5598032b3c36660984e7d49a5ff929ecd6e26 Mon Sep 17 00:00:00 2001
9874f4
From: Richard Hughes <richard@hughsie.com>
9874f4
Date: Mon, 8 Feb 2021 18:41:45 +0000
9874f4
Subject: [PATCH 11/11] wacom-usb: Fix a buffer-overread spotted by
9874f4
 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 d3a41682..ae1e7cac 100644
9874f4
--- plugins/wacom-usb/fu-wac-firmware.c
9874f4
+++ plugins/wacom-usb/fu-wac-firmware.c
9874f4
@@ -65,7 +65,7 @@ fu_wac_firmware_parse (FuFirmware *firmware,
9874f4
 			guint cmdlen = strlen (lines[i]);
9874f4
 
9874f4
 			/* header info record */
9874f4
-			if (memcmp (lines[i] + 2, "COM", 3) == 0) {
9874f4
+			if (cmdlen > 3 && memcmp (lines[i] + 2, "COM", 3) == 0) {
9874f4
 				guint8 header_image_cnt = 0;
9874f4
 				if (cmdlen != 40) {
9874f4
 					g_set_error (error,
9874f4
-- 
9874f4
2.29.2
9874f4