From 81a2bddf49c9269dcb4c75f80cd899c5434edae6 Mon Sep 17 00:00:00 2001 From: Hongbo <12580159+ya0guang@users.noreply.github.com> Date: Tue, 2 Apr 2024 21:12:15 -0400 Subject: [PATCH] fix a potential bug in command validation --- IntelBluetoothFirmware/IntelBluetoothOpsGen1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IntelBluetoothFirmware/IntelBluetoothOpsGen1.cpp b/IntelBluetoothFirmware/IntelBluetoothOpsGen1.cpp index e7213c3..702b8b9 100644 --- a/IntelBluetoothFirmware/IntelBluetoothOpsGen1.cpp +++ b/IntelBluetoothFirmware/IntelBluetoothOpsGen1.cpp @@ -240,7 +240,7 @@ patching(OSData *fwData, const uint8_t **fw_ptr, bool *disablePatch) * the firmware file is corrupted and it should stop the patching * process. */ - if (remain > HCI_COMMAND_HDR_SIZE && *fw_ptr[0] != 0x01) { + if (remain < HCI_COMMAND_HDR_SIZE || *fw_ptr[0] != 0x01) { XYLog("Intel fw corrupted: invalid cmd read\n"); return false; }