StandaloneMmPkg: CodeQL Fixes.

Makes changes to comply with alerts raised by CodeQL.

Most of the issues here fall into the following two categories:

1. Potential use of uninitialized pointer
2. Inconsistent integer width used in loop comparison

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
This commit is contained in:
Michael Kubacki 2024-07-26 13:52:42 -07:00 committed by mergify[bot]
parent e73ec56942
commit d2e8118461
2 changed files with 5 additions and 2 deletions

View File

@ -655,7 +655,10 @@ FvIsBeingProcessed (
DEBUG ((DEBUG_INFO, "FvIsBeingProcessed - 0x%08x\n", FwVolHeader));
KnownFwVol = AllocatePool (sizeof (KNOWN_FWVOL));
ASSERT (KnownFwVol != NULL);
if (KnownFwVol == NULL) {
ASSERT (FALSE);
return;
}
KnownFwVol->Signature = KNOWN_FWVOL_SIGNATURE;
KnownFwVol->FwVolHeader = FwVolHeader;

View File

@ -167,7 +167,7 @@ FfsFindNextFile (
FileOffset = (UINT32)((UINT8 *)FfsFileHeader - (UINT8 *)FwVolHeader);
while (FileOffset < (FvLength - sizeof (EFI_FFS_FILE_HEADER))) {
while ((UINT64)FileOffset < (FvLength - sizeof (EFI_FFS_FILE_HEADER))) {
//
// Get FileState which is the highest bit of the State
//