mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
Fix the bug that could make gMemoryTypeInformation unavailable when gMemoryTypeInformation is filled to EfiMaxMemoryType.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2080 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
c340a28e27
commit
4629ca40b7
@ -2089,7 +2089,7 @@ Returns:
|
||||
if (GuidHob != NULL) {
|
||||
EfiMemoryTypeInformation = GET_GUID_HOB_DATA (GuidHob);
|
||||
DataSize = GET_GUID_HOB_DATA_SIZE (GuidHob);
|
||||
if (EfiMemoryTypeInformation != NULL && DataSize > 0 && DataSize < EfiMaxMemoryType * sizeof (EFI_MEMORY_TYPE_INFORMATION)) {
|
||||
if (EfiMemoryTypeInformation != NULL && DataSize > 0 && DataSize <= (EfiMaxMemoryType + 1) * sizeof (EFI_MEMORY_TYPE_INFORMATION)) {
|
||||
CopyMem (&gMemoryTypeInformation, EfiMemoryTypeInformation, DataSize);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user