From ff28420b56601362654101ffcb7f7716aba4ad0f Mon Sep 17 00:00:00 2001 From: lgao4 Date: Tue, 27 Oct 2009 07:55:00 +0000 Subject: Correctly get the width of orderedlist question. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9376 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/HiiDatabaseDxe/ConfigRouting.c | 54 ++++++++++++---------- 1 file changed, 30 insertions(+), 24 deletions(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index ded9820..e377fc4 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -1043,32 +1043,15 @@ ParseIfrData ( // IfrOrderedList = (EFI_IFR_ORDERED_LIST *) IfrOpHdr; if (IfrOrderedList->Question.VarStoreId != VarStorageData->VarStoreId) { + BlockData = NULL; break; } - + // // Get Offset/Width by Question header and OneOf Flags // VarOffset = IfrOrderedList->Question.VarStoreInfo.VarOffset; VarWidth = IfrOrderedList->MaxContainers; - - // - // Check whether this question is in requested block array. - // - if (!BlockArrayCheck (RequestBlockArray, VarOffset, VarWidth)) { - // - // This question is not in the requested string. Skip it. - // - break; - } - - // - // Check this var question is in the var storage - // - if ((VarOffset + VarWidth) > VarStorageData->Size) { - Status = EFI_INVALID_PARAMETER; - goto Done; - } // // Set Block Data @@ -1084,11 +1067,6 @@ ParseIfrData ( BlockData->OpCode = IfrOpHdr->OpCode; BlockData->Scope = IfrOpHdr->Scope; InitializeListHead (&BlockData->DefaultValueEntry); - - // - // Add Block Data into VarStorageData BlockEntry - // - InsertBlockData (&VarStorageData->BlockEntry, &BlockData); break; case EFI_IFR_CHECKBOX_OP: @@ -1385,12 +1363,40 @@ ParseIfrData ( // Invalid ordered list option data type. // Status = EFI_INVALID_PARAMETER; + FreePool (BlockData); goto Done; } + // // Calculate Ordered list QuestionId width. // BlockData->Width = (UINT16) (BlockData->Width * VarWidth); + // + // Check whether this question is in requested block array. + // + if (!BlockArrayCheck (RequestBlockArray, BlockData->Offset, BlockData->Width)) { + // + // This question is not in the requested string. Skip it. + // + FreePool (BlockData); + BlockData = NULL; + break; + } + // + // Check this var question is in the var storage + // + if ((BlockData->Offset + BlockData->Width) > VarStorageData->Size) { + Status = EFI_INVALID_PARAMETER; + FreePool (BlockData); + goto Done; + } + // + // Add Block Data into VarStorageData BlockEntry + // + InsertBlockData (&VarStorageData->BlockEntry, &BlockData); + // + // No default data for OrderedList. + // BlockData = NULL; break; } -- cgit v1.1