diff options
author | vanjeff <vanjeff> | 2013-09-10 05:15:47 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-09-10 05:15:47 +0000 |
commit | 07985bb01e0cacf5b096bfadbba10f3daa75d148 (patch) | |
tree | bf9619e814cd3d4dcd485a3ee5bde4a9f44f7ba8 | |
parent | 4fac802b692b91298854f068f885b5dd9069d411 (diff) | |
download | edk2-07985bb01e0cacf5b096bfadbba10f3daa75d148.zip edk2-07985bb01e0cacf5b096bfadbba10f3daa75d148.tar.gz edk2-07985bb01e0cacf5b096bfadbba10f3daa75d148.tar.bz2 |
Sync patches r14044, r14046 and r14510 from main trunk.
1. Use EFI_IFR_TYPE_VALUE type variable instead of UINT64 to avoid buffer overflow.
2. Clean the flag before use it to avoid use old error value.
git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2010.SR1@14637 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 7 | ||||
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c index fbc85fb..27e99ff 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c @@ -947,7 +947,7 @@ InternalHiiValidateCurrentSetting ( UINT16 Offset;
UINT16 Width;
UINT64 VarValue;
- UINT64 TmpValue;
+ EFI_IFR_TYPE_VALUE TmpValue;
LIST_ENTRY *Link;
UINT8 *VarBuffer;
UINTN MaxBufferSize;
@@ -1512,9 +1512,10 @@ InternalHiiValidateCurrentSetting ( //
// Check current value is the value of one of option.
//
- TmpValue = 0;
+ ASSERT (IfrOneOfOption->Type <= EFI_IFR_TYPE_NUM_SIZE_64);
+ ZeroMem (&TmpValue, sizeof (EFI_IFR_TYPE_VALUE));
CopyMem (&TmpValue, &IfrOneOfOption->Value, IfrOneOfOption->Header.Length - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value));
- if (VarValue == TmpValue) {
+ if (VarValue == TmpValue.u64) {
//
// The value is one of option value.
// Set OpCode to Zero, don't need check again.
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 9d253a2..25b8b13 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -882,6 +882,7 @@ GetVarStoreType ( GuidStr = NULL;
NameStr = NULL;
TempStr = NULL;
+ *IsEfiVarstore = FALSE;
Status = GetFormPackageData(DataBaseRecord, &HiiFormPackage, &PackageSize);
if (EFI_ERROR (Status)) {
|