diff --git a/.pytool/CISettings.py b/.pytool/CISettings.py index d9e30b961c..c08f578b2c 100644 --- a/.pytool/CISettings.py +++ b/.pytool/CISettings.py @@ -185,6 +185,11 @@ def GetActiveScopes(self): "STUART_CODEQL_AUDIT_ONLY", "TRUE", "Set in CISettings.py") + shell_environment.GetBuildVars().SetValue( + "STUART_CODEQL_FILTER_FILES", + os.path.join(self.GetWorkspaceRoot(), + "CodeQlFilters.yml"), + "Set in CISettings.py") except NameError: pass diff --git a/CodeQlFilters.yml b/CodeQlFilters.yml new file mode 100644 index 0000000000..ec1128f2c7 --- /dev/null +++ b/CodeQlFilters.yml @@ -0,0 +1,15 @@ +## @file +# CodeQL Result Filters for Packages in Mu Plus +# +# Note: Packages that use Mu Basecore can reuse this file to quickly pick up the +# same filters applied to results in the Mu Plus repo. +# +# Copyright (c) Microsoft Corporation +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +{ + "Filters": [ + "-HidPkg/HidMouseAbsolutePointerDxe/HidMouseAbsolutePointerDxe.c:SM02298" + ] +} diff --git a/HidPkg/HidKeyboardDxe/HidKeyboard.c b/HidPkg/HidKeyboardDxe/HidKeyboard.c index d701340f32..cae73117ad 100644 --- a/HidPkg/HidKeyboardDxe/HidKeyboard.c +++ b/HidPkg/HidKeyboardDxe/HidKeyboard.c @@ -983,7 +983,7 @@ ProcessKeyStroke ( // Bytes 3 to n are for normal keycodes // KeyRelease = FALSE; - for (LastKeyCode = 0; LastKeyCode < LastReportKeyCount; LastKeyCode++) { + for (LastKeyCode = 0; (UINTN)LastKeyCode < LastReportKeyCount; LastKeyCode++) { if (!HIDKBD_VALID_KEYCODE (LastReport->KeyCode[LastKeyCode])) { continue; } @@ -993,7 +993,7 @@ ProcessKeyStroke ( // then it is released. Otherwise, it is not released. // KeyRelease = TRUE; - for (KeyCode = 0; KeyCode < CurrentReportKeyCount; KeyCode++) { + for (KeyCode = 0; (UINTN)KeyCode < CurrentReportKeyCount; KeyCode++) { if (!HIDKBD_VALID_KEYCODE (CurrentReport->KeyCode[KeyCode])) { continue; } @@ -1033,7 +1033,7 @@ ProcessKeyStroke ( // Handle normal key's pressing situation // KeyPress = FALSE; - for (KeyCode = 0; KeyCode < CurrentReportKeyCount; KeyCode++) { + for (KeyCode = 0; (UINTN)KeyCode < CurrentReportKeyCount; KeyCode++) { if (!HIDKBD_VALID_KEYCODE (CurrentReport->KeyCode[KeyCode])) { continue; } @@ -1043,7 +1043,7 @@ ProcessKeyStroke ( // then it is pressed. Otherwise, it is not pressed. // KeyPress = TRUE; - for (LastKeyCode = 0; LastKeyCode < LastReportKeyCount; LastKeyCode++) { + for (LastKeyCode = 0; (UINTN)LastKeyCode < LastReportKeyCount; LastKeyCode++) { if (!HIDKBD_VALID_KEYCODE (LastReport->KeyCode[LastKeyCode])) { continue; }