Skip to content

Commit

Permalink
Fix bad CodeQL fix - REBASE with PR 6024
Browse files Browse the repository at this point in the history
  • Loading branch information
spbrogan committed Apr 22, 2024
1 parent 6e49e97 commit be8da02
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,16 +718,21 @@ BmExpandFileDevicePath (
((MediaType == 2) && (BlockIo == NULL))
)
{
NextFullPath = AppendDevicePath (DevicePathFromHandle (Handles[Index]), FilePath);
if (NextFullPath == NULL) {
continue;
}

if (GetNext) {
//this is the break/exit condition. Occurs on first if FullPath input parameter was NULL
//or on the next loop after input parameter FullPath matches NextFullPath.
//NextFullPath will not be NULL so outer loop is broken too
break;
}

NextFullPath = AppendDevicePath (DevicePathFromHandle (Handles[Index]), FilePath);
if (NextFullPath != NULL) {
GetNext = (BOOLEAN)(CompareMem (NextFullPath, FullPath, GetDevicePathSize (NextFullPath)) == 0);
FreePool (NextFullPath);
NextFullPath = NULL;
}
GetNext = (BOOLEAN)(CompareMem (NextFullPath, FullPath, GetDevicePathSize (NextFullPath)) == 0);
FreePool (NextFullPath);
NextFullPath = NULL;
}
}

Expand Down

0 comments on commit be8da02

Please sign in to comment.