From 596773f5e33ec03968b8e8621ff4958b3eeaf412 Mon Sep 17 00:00:00 2001 From: Oliver Smith-Denny Date: Wed, 31 Jan 2024 13:52:26 -0800 Subject: DynamicTablesPkg: AmlLib: Fix CodeQL Issue 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 --- DynamicTablesPkg/Library/Common/AmlLib/AmlEncoding/Aml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Library/Common/AmlLib/AmlEncoding/Aml.c b/DynamicTablesPkg/Library/Common/AmlLib/AmlEncoding/Aml.c index e46dc6c1f1..c67066d28e 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/AmlEncoding/Aml.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/AmlEncoding/Aml.c @@ -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); -- cgit