Skip to content

Commit

Permalink
DynamicTablesPkg: AmlLib: Fix CodeQL Issue
Browse files Browse the repository at this point in the history
Without the addition of this cast, the compiler promotes 1 to
a UINT32, which leads CodeQL to complain that different
size types are being compared.

Signed-off-by: Oliver Smith-Denny <[email protected]>
  • Loading branch information
os-d authored and mergify[bot] committed Oct 7, 2024
1 parent 80d9b44 commit 596773f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DynamicTablesPkg/Library/Common/AmlLib/AmlEncoding/Aml.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ AmlSetPkgLength (
// Write to the Buffer.
*Buffer = LeadByte;
CurrentOffset = 1;
while (CurrentOffset < (Offset + 1)) {
while (CurrentOffset < (Offset + (UINT8)1)) {
CurrentShift = (UINT8)((CurrentOffset - 1) * 8);
ComputedLength = Length & (UINT32)(0x00000FF0 << CurrentShift);
ComputedLength = (ComputedLength) >> (4 + CurrentShift);
Expand Down

0 comments on commit 596773f

Please sign in to comment.