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
This commit is contained in:
lzeng14 2012-05-11 01:33:01 +00:00
parent 2e4c9e0158
commit 4694dd1ba8
1 changed files with 1 additions and 1 deletions

View File

@ -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;
//