diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-10-27 07:55:00 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-10-27 07:55:00 +0000 |
commit | ff28420b56601362654101ffcb7f7716aba4ad0f (patch) | |
tree | 1ca40e5750332e1bc8d449ac9683d5e263d0c5fb /MdeModulePkg/Universal/HiiDatabaseDxe | |
parent | 3cf888f5f90526fa0d613c2a1486e0c1f416bd67 (diff) | |
download | edk2-platforms-ff28420b56601362654101ffcb7f7716aba4ad0f.tar.xz |
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
Diffstat (limited to 'MdeModulePkg/Universal/HiiDatabaseDxe')
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index ded9820def..e377fc4ce0 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;
}
|