]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c
Fixed a bug on the menu display: Following steps to reproduce it:
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / ProcessOptions.c
index d72578ddfbfa52fb37b9bd13b9541802b25d1fc0..447e6a2718d94f07b072aa57d8da862d495e43ef 100644 (file)
@@ -452,6 +452,7 @@ ProcessOptions (
 \r
         FreePool (*OptionString);\r
         *OptionString = NULL;\r
+        return EFI_NOT_FOUND;\r
       }\r
 \r
       if ((OneOfOption->SuppressExpression != NULL) &&\r
@@ -722,6 +723,8 @@ ProcessOptions (
           }\r
 \r
           TempString = AllocateCopyPool ((Maximum + 1) * sizeof (CHAR16), Question->BufferValue);\r
+          ASSERT (TempString != NULL);\r
+          \r
           TempString[Maximum] = L'\0';\r
 \r
           if (StrCmp (StringPtr, TempString) != 0) {\r
@@ -877,6 +880,7 @@ ProcessHelpString (
   //\r
   AllocateSize  = 0x20;\r
   IndexArray    = AllocatePool (AllocateSize * sizeof (UINTN) * 3);\r
+  ASSERT (IndexArray != NULL);\r
 \r
   if (*FormattedString != NULL) {\r
     FreePool (*FormattedString);\r
@@ -892,6 +896,8 @@ ProcessHelpString (
       AllocateSize += 0x10;\r
       OldIndexArray  = IndexArray;\r
       IndexArray = AllocatePool (AllocateSize * sizeof (UINTN) * 3);\r
+      ASSERT (IndexArray != NULL);\r
+      \r
       CopyMem (IndexArray, OldIndexArray, LineCount * sizeof (UINTN) * 3);\r
       FreePool (OldIndexArray);\r
     }\r
@@ -1012,6 +1018,7 @@ ProcessHelpString (
 \r
   VirtualLineCount = RowCount * (LineCount / RowCount + (LineCount % RowCount > 0));\r
   *FormattedString = AllocateZeroPool (VirtualLineCount * (BlockWidth + 1) * sizeof (CHAR16) * 2);\r
+  ASSERT (*FormattedString != NULL);\r
 \r
   for (CurrIndex = 0; CurrIndex < LineCount; CurrIndex ++) {\r
     *(*FormattedString + CurrIndex * 2 * (BlockWidth + 1)) = (CHAR16) ((IndexArray[CurrIndex*3+2] == 2) ? WIDE_CHAR : NARROW_CHAR);\r