diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-12-17 03:30:43 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-12-17 03:30:43 +0000 |
commit | 23fe74dc7633df5b5eca696b817c892aa4042beb (patch) | |
tree | e263347f9a4e5eb1d12f669a52b47363b5490845 /MdeModulePkg/Universal | |
parent | d379cbc75d55fcebfbb86921c72194bb6cb3ca6e (diff) | |
download | edk2-23fe74dc7633df5b5eca696b817c892aa4042beb.zip edk2-23fe74dc7633df5b5eca696b817c892aa4042beb.tar.gz edk2-23fe74dc7633df5b5eca696b817c892aa4042beb.tar.bz2 |
Base on the value type to get the value for default opcode.
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14006 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 2 | ||||
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 1cb754b..ee52034 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -1922,7 +1922,7 @@ ParseIfrData ( //
DefaultData.Type = DefaultValueFromOpcode;
DefaultData.DefaultId = VarDefaultId;
- CopyMem (&DefaultData.Value, &IfrDefault->Value, sizeof (EFI_IFR_TYPE_VALUE));
+ CopyMem (&DefaultData.Value, &IfrDefault->Value, IfrDefault->Header.Length - OFFSET_OF (EFI_IFR_DEFAULT, Value));
// If the value field is expression, set the cleaned flag.
if (IfrDefault->Type == EFI_IFR_TYPE_OTHER) {
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c index 7221c42..7493a94 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c @@ -1779,8 +1779,8 @@ ParseOpCodes ( CurrentDefault->Value.Type = ((EFI_IFR_DEFAULT *) OpCodeData)->Type;
CopyMem (&CurrentDefault->DefaultId, &((EFI_IFR_DEFAULT *) OpCodeData)->DefaultId, sizeof (UINT16));
- if (OpCodeLength == sizeof (EFI_IFR_DEFAULT)) {
- CopyMem (&CurrentDefault->Value.Value, &((EFI_IFR_DEFAULT *) OpCodeData)->Value, sizeof (EFI_IFR_TYPE_VALUE));
+ if (OpCodeLength > OFFSET_OF (EFI_IFR_DEFAULT, Value)) {
+ CopyMem (&CurrentDefault->Value.Value, &((EFI_IFR_DEFAULT *) OpCodeData)->Value, OpCodeLength - OFFSET_OF (EFI_IFR_DEFAULT, Value));
ExtendValueToU64 (&CurrentDefault->Value);
}
|