diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-03-04 11:33:13 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-03-04 11:33:13 +0000 |
commit | 383c303c497d5268f62790de46c5c82d20c65bd6 (patch) | |
tree | 3905de8cc5b176416bb610794c95ffe948e392a9 /MdeModulePkg/Core/Dxe/Gcd | |
parent | 9521b669f88c01003b1ae3dc6824ccac3c7e70b6 (diff) | |
download | edk2-383c303c497d5268f62790de46c5c82d20c65bd6.zip edk2-383c303c497d5268f62790de46c5c82d20c65bd6.tar.gz edk2-383c303c497d5268f62790de46c5c82d20c65bd6.tar.bz2 |
Fix two minor defects:
1. CoreGetMemoryMap() returns unclean data
2. Zero length memory descriptor might be added to the memory map
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4790 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core/Dxe/Gcd')
-rw-r--r-- | MdeModulePkg/Core/Dxe/Gcd/gcd.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Dxe/Gcd/gcd.c b/MdeModulePkg/Core/Dxe/Gcd/gcd.c index 1d02354..3cadab2 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/gcd.c @@ -2473,6 +2473,9 @@ Returns: if (MemorySpaceMap[Index].ImageHandle == NULL) {
BaseAddress = PageAlignAddress (MemorySpaceMap[Index].BaseAddress);
Length = PageAlignLength (MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length - BaseAddress);
+ if (Length == 0 || MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length < BaseAddress) {
+ continue;
+ }
CoreAddMemoryDescriptor (
EfiConventionalMemory,
BaseAddress,
|