From 19b362e879de90ef07ba67cd4f8aa97122f625b0 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Mon, 29 May 2006 04:43:26 +0000 Subject: BaseMemoryLib: Add missing ASSERT()s for some interfaces. BaseTimerLibLocalApic: Add missing EBC architecture support. Note that this instance is a dummy one since EBC does not support local APIC timer. IoLibDxeCpuIo: Add alignment checking & unsupported width checking by using ASSERT()s. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@311 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c') diff --git a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c index 06b2721c64..c54983c77b 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibMmx/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) { -- cgit v1.2.3