summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-14 12:37:02 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-14 12:37:02 +0000
commit76c2425177bc419d8aa03749a57ece4ecde22066 (patch)
tree14378c753c946b71d887db1394405924a283d0b5 /MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
parent84f9a9ec8f84f837b3c0addf1f4681d8f8c71db1 (diff)
downloadedk2-platforms-76c2425177bc419d8aa03749a57ece4ecde22066.tar.xz
Update HiiDataBase to fix parsing Hii package error. Some HiiPackages have no varstore and question, they has no the built in default value.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8314 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c')
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
index 6b278afe17..2761be1018 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
@@ -1728,6 +1728,13 @@ GetFullStringFromHiiFormPackages (
PackageOffset += PacakgeHeader.Length;
}
+
+ //
+ // No requested varstore in IFR data and directly return
+ //
+ if (VarStorageData->Size == 0) {
+ goto Done;
+ }
//
// 3. Construct Request Element (Block Name) for 2.1 and 2.2 case.
@@ -2204,6 +2211,13 @@ HiiConfigRoutingExtractConfig (
if (EFI_ERROR (Status)) {
goto Done;
}
+ //
+ // Not any request block is found.
+ //
+ if (StrStr (ConfigRequest, L"&OFFSET=") == NULL) {
+ AccessResults = AllocateCopyPool (StrSize (ConfigRequest), ConfigRequest);
+ goto NextConfigString;
+ }
}
//
@@ -2261,7 +2275,8 @@ HiiConfigRoutingExtractConfig (
FreePool (DefaultResults);
DefaultResults = NULL;
}
-
+
+NextConfigString:
if (!FirstElement) {
Status = AppendToMultiString (Results, L"&");
ASSERT_EFI_ERROR (Status);
@@ -2292,6 +2307,7 @@ HiiConfigRoutingExtractConfig (
Done:
if (EFI_ERROR (Status)) {
FreePool (*Results);
+ *Results = NULL;
}
if (ConfigRequest != NULL) {
@@ -2783,7 +2799,7 @@ HiiBlockToConfig (
StringPtr++;
}
if (*StringPtr == 0) {
- *Progress = StringPtr;
+ *Progress = StringPtr - 1;
Status = EFI_INVALID_PARAMETER;
goto Exit;
}
@@ -2792,7 +2808,7 @@ HiiBlockToConfig (
StringPtr++;
}
if (*StringPtr == 0) {
- *Progress = StringPtr;
+ *Progress = StringPtr - 1;
Status = EFI_INVALID_PARAMETER;
goto Exit;
}
@@ -2947,7 +2963,10 @@ HiiBlockToConfig (
return EFI_SUCCESS;
Exit:
- FreePool (*Config);
+ if (*Config != NULL) {
+ FreePool (*Config);
+ *Config = NULL;
+ }
if (ValueStr != NULL) {
FreePool (ValueStr);
}
@@ -3401,7 +3420,7 @@ HiiGetAltCfg (
Status = EFI_NOT_FOUND;
Exit:
-
+ *AltCfgResp = NULL;
if (!EFI_ERROR (Status) && (Result != NULL)) {
//
// Copy the <ConfigHdr> and <ConfigBody>