git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8627
6f19259b-4bc3-4df7-8a09-
765794883524
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
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