summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Pei/FwVol/FwVol.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
index f7cc94c6eb..04bec986e4 100644
--- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
+++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
@@ -819,6 +819,10 @@ ProcessSection (
if (!IsFfs3Fv) {
DEBUG ((DEBUG_ERROR, "Found a FFS3 formatted section in a non-FFS3 formatted FV.\n"));
SectionLength = SECTION2_SIZE (Section);
+ if (SectionLength == 0) {
+ break;
+ }
+
//
// SectionLength is adjusted it is 4 byte aligned.
// Go to the next section
@@ -854,6 +858,10 @@ ProcessSection (
SectionLength = SECTION_SIZE (Section);
}
+ if (SectionLength == 0) {
+ break;
+ }
+
//
// SectionLength is adjusted it is 4 byte aligned.
// Go to the next section
@@ -991,6 +999,10 @@ ProcessSection (
SectionLength = SECTION_SIZE (Section);
}
+ if (SectionLength == 0) {
+ break;
+ }
+
//
// SectionLength is adjusted it is 4 byte aligned.
// Go to the next section