diff options
Diffstat (limited to 'MdePkg/Library/PeiMemoryLib/MemLibGuid.c')
-rw-r--r-- | MdePkg/Library/PeiMemoryLib/MemLibGuid.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/MdePkg/Library/PeiMemoryLib/MemLibGuid.c b/MdePkg/Library/PeiMemoryLib/MemLibGuid.c index 06b2721c64..c54983c77b 100644 --- a/MdePkg/Library/PeiMemoryLib/MemLibGuid.c +++ b/MdePkg/Library/PeiMemoryLib/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) {
|