diff options
author | xgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-12-11 02:06:19 +0000 |
---|---|---|
committer | xgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-12-11 02:06:19 +0000 |
commit | 4629ca40b7d22356337ba5811e9220f0dd1e14ce (patch) | |
tree | 62116980a63ec6738106fec9ed945466703bf6c0 /EdkModulePkg | |
parent | c340a28e277f524698ff42ce631f277583772b65 (diff) | |
download | edk2-platforms-4629ca40b7d22356337ba5811e9220f0dd1e14ce.tar.xz |
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
Diffstat (limited to 'EdkModulePkg')
-rw-r--r-- | EdkModulePkg/Core/Dxe/Gcd/gcd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/EdkModulePkg/Core/Dxe/Gcd/gcd.c b/EdkModulePkg/Core/Dxe/Gcd/gcd.c index 208c05a015..0735bf00b9 100644 --- a/EdkModulePkg/Core/Dxe/Gcd/gcd.c +++ b/EdkModulePkg/Core/Dxe/Gcd/gcd.c @@ -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);
}
}
|