summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/GenFds/FdfParser.py
diff options
context:
space:
mode:
authorYunhua Feng <yunhuax.feng@intel.com>2018-07-25 12:21:54 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-07-30 09:29:10 +0800
commit3b46dd93ddf65a2cf1377bc72cdeb8ae3f7d81c8 (patch)
treeceb48ebc625614ebe2bb9c0d1476f5d736657d19 /BaseTools/Source/Python/GenFds/FdfParser.py
parent1bf23e6b7f414b9e6bd471e0b2366400e5d52e45 (diff)
downloadedk2-3b46dd93ddf65a2cf1377bc72cdeb8ae3f7d81c8.tar.gz
edk2-3b46dd93ddf65a2cf1377bc72cdeb8ae3f7d81c8.tar.bz2
edk2-3b46dd93ddf65a2cf1377bc72cdeb8ae3f7d81c8.zip
BaseTools: Fix build crash when fdf is empty file
Fix build crash when fdf is empty file Fix https://bugzilla.tianocore.org/show_bug.cgi?id=912 Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/FdfParser.py')
-rw-r--r--BaseTools/Source/Python/GenFds/FdfParser.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index 4be790a819..8de0b48ff6 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -423,6 +423,8 @@ class FdfParser:
def __StringToList(self):
self.Profile.FileLinesList = [list(s) for s in self.Profile.FileLinesList]
+ if not self.Profile.FileLinesList:
+ EdkLogger.error('FdfParser', FILE_READ_FAILURE, 'The file is empty!', File=self.FileName)
self.Profile.FileLinesList[-1].append(' ')
def __ReplaceFragment(self, StartPos, EndPos, Value = ' '):