From e10293550f62474596d955e44a5af97b0d412305 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Fri, 14 Mar 2008 10:12:17 +0000 Subject: [PATCH] A leaf section type may contains an array of zero or more bytes. Support the section with the zero data. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4852 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Core/Dxe/SectionExtraction/CoreSectionExtraction.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c index 94eb08b5bb..8d33322c42 100644 --- a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c +++ b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c @@ -581,11 +581,13 @@ Returns: } if (IsListEmpty (&SourceStream->Children) && - SourceStream->StreamLength > sizeof (EFI_COMMON_SECTION_HEADER)) { + SourceStream->StreamLength >= sizeof (EFI_COMMON_SECTION_HEADER)) { // // This occurs when a section stream exists, but no child sections // have been parsed out yet. Therefore, extract the first child and add it // to the list of children so we can get started. + // Section stream may contain an array of zero or more bytes. + // So, its size should be >= the size of commen section header. // Status = CreateChildNode (SourceStream, 0, &CurrentChildNode); if (EFI_ERROR (Status)) { -- 2.39.2