mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 08:04:07 +02:00
MdeModulePkg/Core/Pei: Add error handling for Section Length
This patch breaks the section processing loop if an invalid section with zero SectionLength is encountered. Signed-off-by: Ragavarshini B <ragavarshinib@ami.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Dhanaraj V <vdhanaraj@ami.com> Cc: Sachin Ganesh <sachinganesh@ami.com>
This commit is contained in:
parent
9dabe005f0
commit
253b3d678a
@ -819,6 +819,10 @@ ProcessSection (
|
|||||||
if (!IsFfs3Fv) {
|
if (!IsFfs3Fv) {
|
||||||
DEBUG ((DEBUG_ERROR, "Found a FFS3 formatted section in a non-FFS3 formatted FV.\n"));
|
DEBUG ((DEBUG_ERROR, "Found a FFS3 formatted section in a non-FFS3 formatted FV.\n"));
|
||||||
SectionLength = SECTION2_SIZE (Section);
|
SectionLength = SECTION2_SIZE (Section);
|
||||||
|
if (SectionLength == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// SectionLength is adjusted it is 4 byte aligned.
|
// SectionLength is adjusted it is 4 byte aligned.
|
||||||
// Go to the next section
|
// Go to the next section
|
||||||
@ -854,6 +858,10 @@ ProcessSection (
|
|||||||
SectionLength = SECTION_SIZE (Section);
|
SectionLength = SECTION_SIZE (Section);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SectionLength == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// SectionLength is adjusted it is 4 byte aligned.
|
// SectionLength is adjusted it is 4 byte aligned.
|
||||||
// Go to the next section
|
// Go to the next section
|
||||||
@ -991,6 +999,10 @@ ProcessSection (
|
|||||||
SectionLength = SECTION_SIZE (Section);
|
SectionLength = SECTION_SIZE (Section);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SectionLength == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// SectionLength is adjusted it is 4 byte aligned.
|
// SectionLength is adjusted it is 4 byte aligned.
|
||||||
// Go to the next section
|
// Go to the next section
|
||||||
|
Loading…
x
Reference in New Issue
Block a user