Revision: 19747
          http://sourceforge.net/p/edk2/code/19747
Author:   yzhu52
Date:     2016-01-26 08:45:34 +0000 (Tue, 26 Jan 2016)
Log Message:
-----------
BaseTools: Fix the bug when no FD section in the FDF file

Check if the Fdf.CurrentFdName is not None and in Fdf.Profile.FdDict
before using it which fix a crash issue when no FD section in FDF file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <[email protected]>
Reviewed-by: Liming Gao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py

Modified: trunk/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py
===================================================================
--- trunk/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py       2016-01-26 
08:17:19 UTC (rev 19746)
+++ trunk/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py       2016-01-26 
08:45:34 UTC (rev 19747)
@@ -317,11 +317,12 @@
             GlobalData.gFdfParser = Fdf
             GlobalData.gAutoGenPhase = False
             PcdSet = Fdf.Profile.PcdDict
-            FdDict = Fdf.Profile.FdDict[Fdf.CurrentFdName]
-            for FdRegion in FdDict.RegionList:
-                if str(FdRegion.RegionType) is 'FILE' and 
self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):
-                    if int(FdRegion.Offset) % 8 != 0:
-                        EdkLogger.error("build", FORMAT_INVALID, 'The VPD Base 
Address %s must be 8-byte aligned.' % (FdRegion.Offset))
+            if Fdf.CurrentFdName and Fdf.CurrentFdName in Fdf.Profile.FdDict:
+                FdDict = Fdf.Profile.FdDict[Fdf.CurrentFdName]
+                for FdRegion in FdDict.RegionList:
+                    if str(FdRegion.RegionType) is 'FILE' and 
self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):
+                        if int(FdRegion.Offset) % 8 != 0:
+                            EdkLogger.error("build", FORMAT_INVALID, 'The VPD 
Base Address %s must be 8-byte aligned.' % (FdRegion.Offset))
             ModuleList = Fdf.Profile.InfList
             self.FdfProfile = Fdf.Profile
             for fvname in self.FvTargetList:


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to