]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c
Fix potential buffer overflow issue.
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / BootMaint / ConsoleOption.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