X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FGenFds%2FFd.py;h=3716549cbadafbe55a0c56c54193420b7f75a26b;hp=aa4d2e8262d0baaee5f80401cfcc0e423d4d1d41;hb=4afd3d042215afe68d00b9ab8c32f063a3a1c03f;hpb=a365eed476687881ce0ed49af7d483fd3cb0c491 diff --git a/BaseTools/Source/Python/GenFds/Fd.py b/BaseTools/Source/Python/GenFds/Fd.py index aa4d2e8262..3716549cba 100644 --- a/BaseTools/Source/Python/GenFds/Fd.py +++ b/BaseTools/Source/Python/GenFds/Fd.py @@ -113,10 +113,15 @@ class FD(FDClassObject): PreviousRegionStart = RegionObj.Offset PreviousRegionSize = RegionObj.Size # + # Verify current region fits within allocated FD section Size + # + if PreviousRegionStart + PreviousRegionSize > self.Size: + EdkLogger.error("GenFds", GENFDS_ERROR, + 'FD %s size too small to fit region with offset 0x%X and size 0x%X' + % (self.FdUiName, PreviousRegionStart, PreviousRegionSize)) + # # Call each region's AddToBuffer function # - if PreviousRegionSize > self.Size: - EdkLogger.error("GenFds", GENFDS_ERROR, 'FD %s size too small' % self.FdUiName) GenFdsGlobalVariable.VerboseLogger('Call each region\'s AddToBuffer function') RegionObj.AddToBuffer (FdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, self.DefineVarDict) #