summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseMemoryLibOptPei/ZeroMemWrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibOptPei/ZeroMemWrapper.c')
-rw-r--r--MdePkg/Library/BaseMemoryLibOptPei/ZeroMemWrapper.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/ZeroMemWrapper.c b/MdePkg/Library/BaseMemoryLibOptPei/ZeroMemWrapper.c
index e87996a885..398f9ab444 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/ZeroMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/ZeroMemWrapper.c
@@ -50,5 +50,9 @@ ZeroMem (
{
ASSERT (!(Buffer == NULL && Length > 0));
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
+ if (Length == 0) {
+ return Buffer;
+ }
+
return InternalMemZeroMem (Buffer, Length);
}