]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Correctly get the width of orderedlist question.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 27 Oct 2009 07:55:00 +0000 (07:55 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 27 Oct 2009 07:55:00 +0000 (07:55 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9376 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c

index ded9820def88286de80d52fda18e697941989020..e377fc4ce0a71303c05f4f3bed1da59bf0461729 100644 (file)
@@ -1043,32 +1043,15 @@ ParseIfrData (
       //\r
       IfrOrderedList = (EFI_IFR_ORDERED_LIST *) IfrOpHdr;\r
       if (IfrOrderedList->Question.VarStoreId != VarStorageData->VarStoreId) {\r
+        BlockData = NULL;\r
         break;\r
       }\r
-      \r
+\r
       //\r
       // Get Offset/Width by Question header and OneOf Flags\r
       //\r
       VarOffset = IfrOrderedList->Question.VarStoreInfo.VarOffset;\r
       VarWidth  = IfrOrderedList->MaxContainers;\r
-\r
-      //\r
-      // Check whether this question is in requested block array.\r
-      //\r
-      if (!BlockArrayCheck (RequestBlockArray, VarOffset, VarWidth)) {\r
-        //\r
-        // This question is not in the requested string. Skip it.\r
-        //\r
-        break;\r
-      }\r
-\r
-      //\r
-      // Check this var question is in the var storage \r
-      //\r
-      if ((VarOffset + VarWidth) > VarStorageData->Size) {\r
-        Status = EFI_INVALID_PARAMETER;\r
-        goto Done;\r
-      }\r
       \r
       //\r
       // Set Block Data\r
@@ -1084,11 +1067,6 @@ ParseIfrData (
       BlockData->OpCode     = IfrOpHdr->OpCode;\r
       BlockData->Scope      = IfrOpHdr->Scope;\r
       InitializeListHead (&BlockData->DefaultValueEntry);\r
-      \r
-      //\r
-      // Add Block Data into VarStorageData BlockEntry\r
-      //\r
-      InsertBlockData (&VarStorageData->BlockEntry, &BlockData);\r
       break;\r
 \r
     case EFI_IFR_CHECKBOX_OP:\r
@@ -1385,12 +1363,40 @@ ParseIfrData (
           // Invalid ordered list option data type.\r
           //\r
           Status = EFI_INVALID_PARAMETER;\r
+          FreePool (BlockData);\r
           goto Done;\r
         }\r
+\r
         //\r
         // Calculate Ordered list QuestionId width.\r
         //\r
         BlockData->Width = (UINT16) (BlockData->Width * VarWidth);\r
+        //\r
+        // Check whether this question is in requested block array.\r
+        //\r
+        if (!BlockArrayCheck (RequestBlockArray, BlockData->Offset, BlockData->Width)) {\r
+          //\r
+          // This question is not in the requested string. Skip it.\r
+          //\r
+          FreePool (BlockData);\r
+          BlockData = NULL;\r
+          break;\r
+        }\r
+        //\r
+        // Check this var question is in the var storage \r
+        //\r
+        if ((BlockData->Offset + BlockData->Width) > VarStorageData->Size) {\r
+          Status = EFI_INVALID_PARAMETER;\r
+          FreePool (BlockData);\r
+          goto Done;\r
+        }\r
+        //\r
+        // Add Block Data into VarStorageData BlockEntry\r
+        //\r
+        InsertBlockData (&VarStorageData->BlockEntry, &BlockData);\r
+        //\r
+        // No default data for OrderedList.\r
+        //\r
         BlockData = NULL;\r
         break;\r
       }\r