]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c
Fix a bug in SetupBrowserDxe driver when check current user's access setup permission...
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / ProcessOptions.c
index 3dfb567c0faa3ed1e27b917279659b0dc717dd56..5eeec77af22472a6d9801ffff896f52e175d1bec 100644 (file)
@@ -2,7 +2,7 @@
 Implementation for handling the User Interface option processing.\r
 \r
 \r
-Copyright (c) 2004 - 2009, Intel Corporation\r
+Copyright (c) 2004 - 2010, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include "Ui.h"\r
 #include "Setup.h"\r
 \r
 \r
@@ -422,6 +421,12 @@ ProcessOptions (
 \r
   switch (Question->Operand) {\r
   case EFI_IFR_ORDERED_LIST_OP:\r
+    //\r
+    // Check whether there are Options of this OrderedList\r
+    //\r
+    if (IsListEmpty (&Question->OptionListHead)) {\r
+      break;\r
+    }\r
     //\r
     // Initialize Option value array\r
     //\r
@@ -509,6 +514,12 @@ ProcessOptions (
     break;\r
 \r
   case EFI_IFR_ONE_OF_OP:\r
+    //\r
+    // Check whether there are Options of this OneOf\r
+    //\r
+    if (IsListEmpty (&Question->OptionListHead)) {\r
+      break;\r
+    }\r
     if (Selected) {\r
       //\r
       // Go ask for input\r
@@ -819,7 +830,7 @@ ProcessOptions (
 \r
           TempString = AllocateCopyPool ((Maximum + 1) * sizeof (CHAR16), Question->BufferValue);\r
           ASSERT (TempString != NULL);\r
-          \r
+\r
           TempString[Maximum] = L'\0';\r
 \r
           if (StrCmp (StringPtr, TempString) != 0) {\r
@@ -965,7 +976,7 @@ ProcessHelpString (
   UINTN *OldIndexArray;\r
 \r
   BlockWidth = (UINTN) gHelpBlockWidth - 1;\r
-  \r
+\r
   //\r
   // every three elements of IndexArray form a screen-line of string:[ IndexArray[i*3], IndexArray[i*3+1] )\r
   // IndexArray[i*3+2] stores the initial glyph width of single character. to save this is because we want\r
@@ -992,7 +1003,7 @@ ProcessHelpString (
       OldIndexArray  = IndexArray;\r
       IndexArray = AllocatePool (AllocateSize * sizeof (UINTN) * 3);\r
       ASSERT (IndexArray != NULL);\r
-      \r
+\r
       CopyMem (IndexArray, OldIndexArray, LineCount * sizeof (UINTN) * 3);\r
       FreePool (OldIndexArray);\r
     }\r