]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix potential buffer overflow issue.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 23 Jun 2009 08:57:31 +0000 (08:57 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 23 Jun 2009 08:57:31 +0000 (08:57 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8627 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c
IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c

index 06fd0e0af775c3eb33aa62abe5ff6ef31d315bd7..c6c9915f55f95f2cbb97d1b44d05babc0a892688 100644 (file)
@@ -755,6 +755,7 @@ GetConsoleMenu (
     NewMenuEntry->OptionNumber    = Index2;\r
 \r
     NewConsoleContext->DevicePath = DuplicateDevicePath (DevicePathInst);\r
+    ASSERT (NewConsoleContext->DevicePath != NULL);\r
     NewMenuEntry->DisplayString   = EfiLibStrFromDatahub (NewConsoleContext->DevicePath);\r
     if (NULL == NewMenuEntry->DisplayString) {\r
       NewMenuEntry->DisplayString = DevicePathToStr (NewConsoleContext->DevicePath);\r
index 3ce9c0ebad6753a6a4150b14686a3fe717f060fe..72139a8b4da668fd2bfd91bc1ac3a3d1b40df55e 100644 (file)
@@ -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