X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FDxeMemoryAllocationLib%2FMemoryAllocationLib.c;h=15a419bc566af3dc8e6f178e5c4afb1418ee51a9;hp=088a10bb5623f5f27bb67084f979226909a91c18;hb=9a462b415d8c9636bfb29a2cfb141e69c3c092b7;hpb=8840ad589e758e0aa57982f5b7acfa898c63c409 diff --git a/MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c index 088a10bb56..15a419bc56 100644 --- a/MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c @@ -474,6 +474,9 @@ InternalAllocateCopyPool ( { VOID *Memory; + ASSERT (Buffer != NULL); + ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1)); + Memory = InternalAllocatePool (PoolType, AllocationSize); if (Memory != NULL) { Memory = CopyMem (Memory, Buffer, AllocationSize); @@ -793,6 +796,9 @@ InternalAllocateAlignedCopyPool ( { VOID *Memory; + ASSERT (Buffer != NULL); + ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1)); + Memory = InternalAllocateAlignedPool (PoolType, AllocationSize, Alignment); if (Memory != NULL) { Memory = CopyMem (Memory, Buffer, AllocationSize);