Skip to content

Commit

Permalink
FmpDevicePkg/FmpDependencyLib: Fix potential overflow in loop
Browse files Browse the repository at this point in the history
FmpVersionsCount is a UINTN while the loop index variable compared
against it is a UINT8. This can lead to an overflow of the loop
index for FmpVersionsCount values larger than UINT8_MAX. This change
makes Index a UINTN to match in width.

Signed-off-by: Michael Kubacki <[email protected]>
  • Loading branch information
makubacki authored and mergify[bot] committed Oct 9, 2024
1 parent 550c38a commit 06da7da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ EvaluateDependency (
{
EFI_STATUS Status;
UINT8 *Iterator;
UINT8 Index;
UINTN Index;
DEPEX_ELEMENT Element1;
DEPEX_ELEMENT Element2;
GUID ImageTypeId;
Expand Down

0 comments on commit 06da7da

Please sign in to comment.