X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseMemoryLibRepStr%2FMemLibGuid.c;h=8932af7083ebfbf5b36d45b53b9be140a48c9333;hp=351e370c2cc8d63e028ad4a9fcffe7373bff7b76;hb=add13dc21720eff1a37fdea34c0fef190e2ad37d;hpb=c16ade35ca4b293255fea78aaf33783501f90f9f diff --git a/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c index 351e370c2c..8932af7083 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c @@ -19,7 +19,7 @@ BaseMemoryLibSse2 BaseMemoryLibRepStr PeiMemoryLib - UefiMemoryLib + DxeMemoryLib **/ @@ -95,7 +95,8 @@ CompareGuid ( GUID in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. If Length > 0 and Buffer is NULL, then ASSERT(). - If Buffer is not aligned on a 64-bit boundary, then ASSERT(). + If Buffer is not aligned on a 32-bit boundary, then ASSERT(). + If Length is not aligned on a 128-bit boundary, then ASSERT(). If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @@ -115,16 +116,12 @@ ScanGuid ( { CONST GUID *GuidPtr; - ASSERT (Buffer != NULL); - // - // Make sure Buffer is aligned on a 64-bit boundary. - // - ASSERT (((UINTN) Buffer & 7) == 0); - + ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0); ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1)); + ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0); GuidPtr = (GUID*)Buffer; - Buffer = GuidPtr + Length / sizeof (*GuidPtr); + Buffer = GuidPtr + Length / sizeof (*GuidPtr); while (GuidPtr < (CONST GUID*)Buffer) { if (CompareGuid (GuidPtr, Guid)) { return (VOID*)GuidPtr;