From 3b46dd93ddf65a2cf1377bc72cdeb8ae3f7d81c8 Mon Sep 17 00:00:00 2001 From: Yunhua Feng Date: Wed, 25 Jul 2018 12:21:54 +0800 Subject: [PATCH] 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 Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/GenFds/FdfParser.py | 2 ++ 1 file changed, 2 insertions(+) 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 = ' '):