From 0dc99784366897508ea0309df6e2a75f85662fcc Mon Sep 17 00:00:00 2001 From: vanjeff Date: Wed, 4 Mar 2009 04:31:46 +0000 Subject: add check for invalid handle. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7795 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'MdeModulePkg/Bus/Usb/UsbKbDxe') diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c index c78305e780..e2c86b07b4 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c @@ -1102,6 +1102,10 @@ USBKeyboardUnregisterKeyNotify ( if (NotificationHandle == NULL) { return EFI_INVALID_PARAMETER; } + + if (((KEYBOARD_CONSOLE_IN_EX_NOTIFY *) NotificationHandle)->Signature != USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE) { + return EFI_INVALID_PARAMETER; + } UsbKeyboardDevice = TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (This); -- cgit v1.2.3