diff options
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 24 | ||||
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 2 |
2 files changed, 10 insertions, 16 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index c79a4c9..1cb754b 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -3919,18 +3919,14 @@ HiiConfigToBlock ( Status = EFI_INVALID_PARAMETER;
goto Exit;
}
- //
- // Skip '&'
- //
- StringPtr++;
//
// Parse each <ConfigElement> if exists
- // Only <BlockConfig> format is supported by this help function.
+ // Only '&'<BlockConfig> format is supported by this help function.
// <BlockConfig> ::= 'OFFSET='<Number>&'WIDTH='<Number>&'VALUE='<Number>
//
- while (*StringPtr != 0 && StrnCmp (StringPtr, L"OFFSET=", StrLen (L"OFFSET=")) == 0) {
- StringPtr += StrLen (L"OFFSET=");
+ while (*StringPtr != 0 && StrnCmp (StringPtr, L"&OFFSET=", StrLen (L"&OFFSET=")) == 0) {
+ StringPtr += StrLen (L"&OFFSET=");
//
// Get Offset
//
@@ -3949,7 +3945,7 @@ HiiConfigToBlock ( StringPtr += Length;
if (StrnCmp (StringPtr, L"&WIDTH=", StrLen (L"&WIDTH=")) != 0) {
- *Progress = StringPtr - Length - StrLen (L"OFFSET=") - 1;
+ *Progress = StringPtr - Length - StrLen (L"&OFFSET=");
Status = EFI_INVALID_PARAMETER;
goto Exit;
}
@@ -3990,7 +3986,7 @@ HiiConfigToBlock ( StringPtr += Length;
if (*StringPtr != 0 && *StringPtr != L'&') {
- *Progress = StringPtr - Length - 7;
+ *Progress = StringPtr - Length - StrLen (L"&VALUE=");
Status = EFI_INVALID_PARAMETER;
goto Exit;
}
@@ -4009,20 +4005,18 @@ HiiConfigToBlock ( Value = NULL;
//
- // If '\0', parsing is finished. Otherwise skip '&' to continue
+ // If '\0', parsing is finished.
//
if (*StringPtr == 0) {
break;
}
-
- StringPtr++;
}
//
- // The input string is ConfigAltResp format.
+ // The input string is not ConfigResp format, return error.
//
- if ((*StringPtr != 0) && (StrnCmp (StringPtr, L"&GUID=", StrLen (L"&GUID=")) != 0)) {
- *Progress = StringPtr - 1;
+ if (*StringPtr != 0) {
+ *Progress = StringPtr;
Status = EFI_INVALID_PARAMETER;
goto Exit;
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index 381cefe..bcc8e02 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -3513,7 +3513,7 @@ LoadStorage ( //
// Convert Result from <ConfigAltResp> to <ConfigResp>
//
- StrPtr = StrStr (Result, L"ALTCFG");
+ StrPtr = StrStr (Result, L"&GUID=");
if (StrPtr != NULL) {
*StrPtr = L'\0';
}
|