diff options
Diffstat (limited to 'MdePkg/Library/BaseMemoryLib/MemLibGuid.c')
-rw-r--r-- | MdePkg/Library/BaseMemoryLib/MemLibGuid.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c b/MdePkg/Library/BaseMemoryLib/MemLibGuid.c index 06b2721c64..c54983c77b 100644 --- a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLib/MemLibGuid.c @@ -119,6 +119,14 @@ ScanGuid ( {
CONST GUID *GuidPtr;
+ ASSERT (Buffer != NULL);
+ //
+ // Make sure Buffer is aligned on a 64-bit boundary.
+ //
+ ASSERT (((UINTN) Buffer & 7) == 0);
+
+ ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
+
GuidPtr = (GUID*)Buffer;
Buffer = GuidPtr + Length / sizeof (*GuidPtr);
while (GuidPtr < (CONST GUID*)Buffer) {
|