X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FCore%2FDxe%2FSectionExtraction%2FCoreSectionExtraction.c;h=243b6b27aeccdadb0c4384a2739307330f38f3ea;hp=d2c40049d26935ed932b5f5f5ec9b09224159474;hb=3140ceda761b4a5ed4de72d1314f7f391691b1c0;hpb=f3f2e05db8c89628498ec4efdb16184747824c63 diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c index d2c40049d2..243b6b27ae 100644 --- a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c +++ b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c @@ -27,7 +27,7 @@ 3) A support protocol is not found, and the data is not available to be read without it. This results in EFI_PROTOCOL_ERROR. -Copyright (c) 2006 - 2008, Intel Corporation.
+Copyright (c) 2006 - 2010, Intel Corporation.
All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -471,7 +471,7 @@ ChildIsType ( if (Child->Type != SearchType) { return FALSE; } - if (SearchType != EFI_SECTION_GUID_DEFINED) { + if ((SearchType != EFI_SECTION_GUID_DEFINED) || (SectionDefinitionGuid == NULL)) { return TRUE; } GuidedSection = (EFI_GUID_DEFINED_SECTION * )(Stream->StreamBuffer + Child->OffsetInStream); @@ -580,8 +580,8 @@ CreateChildNode ( // Decompress the stream // Status = CoreLocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **)&Decompress); - ASSERT_EFI_ERROR (Status); + ASSERT (Decompress != NULL); Status = Decompress->GetInfo ( Decompress, @@ -635,7 +635,7 @@ CreateChildNode ( GuidedHeader = (EFI_GUID_DEFINED_SECTION *) SectionHeader; Node->EncapsulationGuid = &GuidedHeader->SectionDefinitionGuid; Status = CoreLocateProtocol (Node->EncapsulationGuid, NULL, (VOID **)&GuidedExtraction); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR (Status) && GuidedExtraction != NULL) { // // NewStreamBuffer is always allocated by ExtractSection... No caller // allocation here. @@ -807,6 +807,7 @@ FindChildNode ( CurrentChildNode = CHILD_SECTION_NODE_FROM_LINK (GetFirstNode(&SourceStream->Children)); for (;;) { + ASSERT (CurrentChildNode != NULL); if (ChildIsType (SourceStream, CurrentChildNode, SearchType, SectionDefinitionGuid)) { // // The type matches, so check the instance count to see if it's the one we want