From 26fab514ee8fc04721d3940c7db6a60df4e8ed1d Mon Sep 17 00:00:00 2001 From: vanjeff Date: Thu, 2 Jun 2011 06:51:59 +0000 Subject: [PATCH] Fix the issue when checking the value of KeyDescriptor->Modifier to see if it was out of bounds. Signed-off-by: vanjeff Reviewed-by: rsun3 Reviewed-by: erictian git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11723 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c index a11333ccf5..859a4dece3 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c @@ -1562,7 +1562,7 @@ UsbKeyCodeToEfiInputKey ( // // Make sure modifier of Key Descriptor is in the valid range according to UEFI spec. // - if (KeyDescriptor->Modifier > (sizeof (ModifierValueToEfiScanCodeConvertionTable) / sizeof (UINT8))) { + if (KeyDescriptor->Modifier >= (sizeof (ModifierValueToEfiScanCodeConvertionTable) / sizeof (UINT8))) { return EFI_DEVICE_ERROR; }