summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core/Dxe
diff options
context:
space:
mode:
authorJian J Wang <jian.j.wang@intel.com>2017-12-16 17:22:35 +0800
committerStar Zeng <star.zeng@intel.com>2017-12-19 15:19:46 +0800
commit3d817fd11af6a4981978f6c0d5648ce470aa92b5 (patch)
tree5e5ffa65fea02c5992aaf2918a19fcd02da2cc22 /MdeModulePkg/Core/Dxe
parente9dfa1b519cddfb7ceb93706d527ac25f36606c2 (diff)
downloadedk2-3d817fd11af6a4981978f6c0d5648ce470aa92b5.tar.gz
edk2-3d817fd11af6a4981978f6c0d5648ce470aa92b5.tar.bz2
edk2-3d817fd11af6a4981978f6c0d5648ce470aa92b5.zip
MdeModulePkg/Core: Fix incorrect memory map generated in a rare case
The root cause is that mImagePropertiesPrivateData.CodeSegmentCountMax was not updated with correct value due to the fact that SortImageRecord() called before might change the content of current ImageRecord. This will in turn cause incorrect memory map entries generated in SplitTable(). Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'MdeModulePkg/Core/Dxe')
-rw-r--r--MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
index 75d9b14c1f..a84507df95 100644
--- a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
+++ b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
@@ -1229,12 +1229,12 @@ InsertImageRecord (
InsertTailList (&mImagePropertiesPrivateData.ImageRecordList, &ImageRecord->Link);
mImagePropertiesPrivateData.ImageRecordCount++;
- SortImageRecord ();
-
if (mImagePropertiesPrivateData.CodeSegmentCountMax < ImageRecord->CodeSegmentCount) {
mImagePropertiesPrivateData.CodeSegmentCountMax = ImageRecord->CodeSegmentCount;
}
+ SortImageRecord ();
+
Finish:
return ;
}