]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
Fix the potential issue that using integrate as BOOLEAN value in judgment.
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / Hotkey.c
index 3ce9c0ebad6753a6a4150b14686a3fe717f060fe..99c3306ec9985fcd4aa58f024a8b94a22a12fe7f 100644 (file)
@@ -349,7 +349,7 @@ HotkeyCallback (
     HotkeyData = &Hotkey->KeyData[Hotkey->WaitingKey];\r
     if ((KeyData->Key.ScanCode == HotkeyData->Key.ScanCode) &&\r
        (KeyData->Key.UnicodeChar == HotkeyData->Key.UnicodeChar) &&\r
-       ((HotkeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) ? (KeyData->KeyState.KeyShiftState == HotkeyData->KeyState.KeyShiftState) : TRUE)) {\r
+       (((HotkeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) != 0) ? (KeyData->KeyState.KeyShiftState == HotkeyData->KeyState.KeyShiftState) : TRUE)) {\r
       //\r
       // Receive an expecting key stroke\r
       //\r
@@ -469,7 +469,7 @@ HotkeyRegisterNotify (
         return Status;\r
       }\r
       Index ++;\r
-    } while (Index < Hotkey->CodeCount);\r
+    } while ((Index < Hotkey->CodeCount) && (Index < (sizeof (Hotkey->KeyData) / sizeof (EFI_KEY_DATA))));\r
 \r
     Link = GetNextNode (&mHotkeyList, Link);\r
   }\r