if (Child->Type != SearchType) {\r
return FALSE;\r
}\r
- if (SearchType != EFI_SECTION_GUID_DEFINED) {\r
+ if ((SearchType != EFI_SECTION_GUID_DEFINED) || (SectionDefinitionGuid == NULL)) {\r
return TRUE;\r
}\r
GuidedSection = (EFI_GUID_DEFINED_SECTION * )(Stream->StreamBuffer + Child->OffsetInStream);\r
CurrentChildNode = CHILD_SECTION_NODE_FROM_LINK (GetFirstNode(&SourceStream->Children));\r
\r
for (;;) {\r
+ ASSERT (CurrentChildNode != NULL);\r
if (ChildIsType (SourceStream, CurrentChildNode, SearchType, SectionDefinitionGuid)) {\r
//\r
// The type matches, so check the instance count to see if it's the one we want\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- ASSERT (CurrentChildNode != NULL);\r
} else {\r
ASSERT (EFI_ERROR (ErrorStatus));\r
return ErrorStatus;\r