summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-13 05:20:23 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-13 05:20:23 +0000
commit0194d26cb8427513c2cb78398e3d529bb0a44bf4 (patch)
tree78aa2bbe0f695373c5d8322ecd678a66e0c5ff5c /MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
parent9de33db48b8e24aa8fa446a6e6983b4e40126fe5 (diff)
downloadedk2-platforms-0194d26cb8427513c2cb78398e3d529bb0a44bf4.tar.xz
1. When get value from AltCfg data, check the varstore type first.
2. Check the pointer's validation before using it. Signed-off-by:ydong10 Reviewed-by:lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11816 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Setup.c')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
index dbf6a79b8c..fa721f6d16 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
@@ -2133,6 +2133,7 @@ GetDefaultValueFromAltCfg (
ConfigRequest = NULL;
Result = NULL;
ConfigResp = NULL;
+ Value = NULL;
Storage = Question->Storage;
if ((Storage == NULL) || (Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE)) {
@@ -2213,12 +2214,18 @@ GetDefaultValueFromAltCfg (
//
// Skip <ConfigRequest>
//
- Value = StrStr (ConfigResp, L"&VALUE");
if (IsBufferStorage) {
+ Value = StrStr (ConfigResp, L"&VALUE");
+ ASSERT (Value != NULL);
//
// Skip "&VALUE"
//
Value = Value + 6;
+ } else {
+ Value = StrStr (ConfigResp, Question->VariableName);
+ ASSERT (Value != NULL);
+
+ Value = Value + StrLen (Question->VariableName);
}
if (*Value != '=') {
Status = EFI_NOT_FOUND;