summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c')
-rw-r--r--MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c b/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c
index 155877fdde..5ca62f5047 100644
--- a/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c
+++ b/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c
@@ -23,7 +23,7 @@
**/
-#include "MemLibWrappers.h"
+#include "MemLibInternals.h"
/**
Copy Length bytes from Source to Destination.
@@ -51,8 +51,14 @@ CopyMem (
IN UINTN Length
)
{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Destination + 1);
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Source + 1);
+ ASSERT (
+ Destination == NULL ||
+ Length <= MAX_ADDRESS - (UINTN)Destination + 1
+ );
+ ASSERT (
+ Source == NULL ||
+ Length <= MAX_ADDRESS - (UINTN)Source + 1
+ );
if (Destination == Source || Length == 0) {
return Destination;
}