Skip to content

Commit

Permalink
StandaloneMmPkg: CodeQL Fixes.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
makubacki authored and mergify[bot] committed Oct 3, 2024
1 parent e73ec56 commit d2e8118
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion StandaloneMmPkg/Core/Dispatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion StandaloneMmPkg/Library/FvLib/FvLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down

0 comments on commit d2e8118

Please sign in to comment.