add check for invalid handle.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7795 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2009-03-04 04:31:46 +00:00
parent ea43036162
commit 0dc9978436
5 changed files with 22 additions and 2 deletions

View File

@ -684,7 +684,11 @@ KeyboardUnregisterKeyNotify (
if (NotificationHandle == NULL) { if (NotificationHandle == NULL) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (((KEYBOARD_CONSOLE_IN_EX_NOTIFY *) NotificationHandle)->Signature != KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE) {
return EFI_INVALID_PARAMETER;
}
ConsoleInDev = TEXT_INPUT_EX_KEYBOARD_CONSOLE_IN_DEV_FROM_THIS (This); ConsoleInDev = TEXT_INPUT_EX_KEYBOARD_CONSOLE_IN_DEV_FROM_THIS (This);
// //

View File

@ -1102,6 +1102,10 @@ USBKeyboardUnregisterKeyNotify (
if (NotificationHandle == NULL) { if (NotificationHandle == NULL) {
return EFI_INVALID_PARAMETER; 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); UsbKeyboardDevice = TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (This);

View File

@ -3921,6 +3921,10 @@ ConSplitterTextInUnregisterKeyNotify (
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (((TEXT_IN_EX_SPLITTER_NOTIFY *) NotificationHandle)->Signature != TEXT_IN_EX_SPLITTER_NOTIFY_SIGNATURE) {
return EFI_INVALID_PARAMETER;
}
Private = TEXT_IN_EX_SPLITTER_PRIVATE_DATA_FROM_THIS (This); Private = TEXT_IN_EX_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
// //

View File

@ -445,6 +445,10 @@ TerminalConInUnregisterKeyNotify (
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (((TERMINAL_CONSOLE_IN_EX_NOTIFY *) NotificationHandle)->Signature != TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE) {
return EFI_INVALID_PARAMETER;
}
TerminalDevice = TERMINAL_CON_IN_EX_DEV_FROM_THIS (This); TerminalDevice = TERMINAL_CON_IN_EX_DEV_FROM_THIS (This);
NotifyList = &TerminalDevice->NotifyList; NotifyList = &TerminalDevice->NotifyList;

View File

@ -797,7 +797,11 @@ WinNtGopSimpleTextInExUnregisterKeyNotify (
if (NotificationHandle == NULL) { if (NotificationHandle == NULL) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if (((WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY *) NotificationHandle)->Signature != WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE) {
return EFI_INVALID_PARAMETER;
}
Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This); Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);
for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) { for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) {