summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-05-11 01:33:01 +0000
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-05-11 01:33:01 +0000
commit4694dd1ba8ad0242a7cf7467568ce001619d3fde (patch)
treee9b33a85f60bc0bdd9517ff28a90ecdcf37fc9bc /MdeModulePkg
parent2e4c9e0158cc10226dc0e2de679bc984e288f18a (diff)
downloadedk2-4694dd1ba8ad0242a7cf7467568ce001619d3fde.zip
edk2-4694dd1ba8ad0242a7cf7467568ce001619d3fde.tar.gz
edk2-4694dd1ba8ad0242a7cf7467568ce001619d3fde.tar.bz2
DestPtr may point to the lower aligned address in the free memory region (FreeMemBase, FreeMemBase + FreeMemSize), the free memory region may be updated to override the private signature. So update FreeMemSize to avoid the potential overlap.
Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13303 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c b/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c
index 0428111..a95b472 100644
--- a/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c
+++ b/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c
@@ -945,7 +945,7 @@ CapsuleDataCoalesce (
DestPtr = FreeMemBase + FreeMemSize - CapsuleSize;
DestPtr = (UINT8 *) ((UINTN) DestPtr &~ (UINTN) (sizeof (UINTN) - 1));
FreeMemBase = (UINT8 *) BlockList + DescriptorsSize;
- FreeMemSize = FreeMemSize - DescriptorsSize - CapsuleSize;
+ FreeMemSize = (UINTN) DestPtr - (UINTN) FreeMemBase;
NewCapsuleBase = (VOID *) DestPtr;
//