Skip to content

Commit d15b572

Browse files
makubackiTaylorBeebepohanchkenlautneros-d
authored andcommitted
MdeModulePkg: SectionExtractionPei cumulative codeql issues.
Running Codeql on MdeModulePkg/Universal/SectionExtractionPei drivers results in codeql errors stemming from missing null tests. Signed-off-by: Aaron Pop <aaronpop@microsoft.com> Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com> Co-authored-by: Taylor Beebe <tabeebe@microsoft.com> Co-authored-by: pohanch <125842322+pohanch@users.noreply.github.com> Co-authored-by: kenlautner <85201046+kenlautner@users.noreply.github.com> Co-authored-by: Oliver Smith-Denny <osde@linux.microsoft.com> Co-authored-by: Sean Brogan <sean.brogan@microsoft.com> Co-authored-by: Aaron <aaronpop@microsoft>
1 parent 6cc56c6 commit d15b572

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

MdeModulePkg/Universal/SectionExtractionPei/SectionExtractionPei.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,15 @@ SectionExtractionPeiEntry (
251251
if (ExtractHandlerNumber > 0) {
252252
GuidPpi = (EFI_PEI_PPI_DESCRIPTOR *)AllocatePool (ExtractHandlerNumber * sizeof (EFI_PEI_PPI_DESCRIPTOR));
253253
ASSERT (GuidPpi != NULL);
254-
while (ExtractHandlerNumber-- > 0) {
255-
GuidPpi->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
256-
GuidPpi->Ppi = (VOID *)&mCustomGuidedSectionExtractionPpi;
257-
GuidPpi->Guid = &ExtractHandlerGuidTable[ExtractHandlerNumber];
258-
Status = PeiServicesInstallPpi (GuidPpi++);
259-
ASSERT_EFI_ERROR (Status);
254+
255+
if (GuidPpi != NULL) {
256+
while (ExtractHandlerNumber-- > 0) {
257+
GuidPpi->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
258+
GuidPpi->Ppi = (VOID *)&mCustomGuidedSectionExtractionPpi;
259+
GuidPpi->Guid = &ExtractHandlerGuidTable[ExtractHandlerNumber];
260+
Status = PeiServicesInstallPpi (GuidPpi++);
261+
ASSERT_EFI_ERROR (Status);
262+
}
260263
}
261264
}
262265

0 commit comments

Comments
 (0)