summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorcinnamon shia <cinnamon.shia@hpe.com>2018-05-11 23:21:11 +0800
committerStar Zeng <star.zeng@intel.com>2018-05-14 10:04:50 +0800
commitd741d1419350dc4ae868d4a9396f9da33a3416a0 (patch)
treeaab0bc6c437d9942335028d617f8fcc4c7a57fd2 /MdeModulePkg/Universal
parentc61db18e5d11e4c25e32bfb3f999a88e3207eb5f (diff)
downloadedk2-d741d1419350dc4ae868d4a9396f9da33a3416a0.zip
edk2-d741d1419350dc4ae868d4a9396f9da33a3416a0.tar.gz
edk2-d741d1419350dc4ae868d4a9396f9da33a3416a0.tar.bz2
MdeModulePkg Variable: Fix a corner case issue about setting a variable
Fix the issue that failed to update or add a UEFI variable if the remaining size is equal to the data size of the variable. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: cinnamon shia <cinnamon.shia@hpe.com> Signed-off-by: Ansen Huang <ansen.huang@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 6caf603..7303681 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -17,7 +17,7 @@
integer overflow. It should also check attribute to avoid authentication bypass.
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
+(C) Copyright 2015-2018 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -288,7 +288,7 @@ UpdateVariableStore (
DataPtr += mVariableModuleGlobal->VariableGlobal.NonVolatileVariableBase;
}
- if ((DataPtr + DataSize) >= ((EFI_PHYSICAL_ADDRESS) (UINTN) ((UINT8 *) FwVolHeader + FwVolHeader->FvLength))) {
+ if ((DataPtr + DataSize) > ((EFI_PHYSICAL_ADDRESS) (UINTN) ((UINT8 *) FwVolHeader + FwVolHeader->FvLength))) {
return EFI_INVALID_PARAMETER;
}
} else {
@@ -301,7 +301,7 @@ UpdateVariableStore (
DataPtr += mVariableModuleGlobal->VariableGlobal.VolatileVariableBase;
}
- if ((DataPtr + DataSize) >= ((UINTN) ((UINT8 *) VolatileBase + VolatileBase->Size))) {
+ if ((DataPtr + DataSize) > ((UINTN) ((UINT8 *) VolatileBase + VolatileBase->Size))) {
return EFI_INVALID_PARAMETER;
}