Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CHERRY-PICK] MdeModulePkg/TraceHubDebugSysTLib: Use wider type for l…
…oop comparisons (microsoft#775) ## Description Resolves a new CodeQL error due to the value being incremented in the loop being a narrower type than the variable it is being compared against. The variable is changed to a UINT32 type so it has the same width as the type it is being compared against. Issue explanation: In a loop condition, comparison of a value of a narrow type with a value of a wide type may result in unexpected behavior if the wider value is sufficiently large (or small). This is because the narrower value may overflow. This can lead to an infinite loop. Cc: Liming Gao <[email protected]> Cc: Gua Guo <[email protected]> Cc: Prakashan Krishnadas Veliyathuparambil <[email protected]> Cc: K N Karthik <[email protected]> Signed-off-by: Michael Kubacki <[email protected]> Reviewed-by: Gua Guo <[email protected]> (cherry picked from commit 33c81c2) - [ ] Impacts functionality? - **Functionality** - Does the change ultimately impact how firmware functions? - Examples: Add a new library, publish a new PPI, update an algorithm, ... - [ ] Impacts security? - **Security** - Does the change have a direct security impact on an application, flow, or firmware? - Examples: Crypto algorithm change, buffer overflow fix, parameter validation improvement, ... - [ ] Breaking change? - **Breaking change** - Will anyone consuming this change experience a break in build or boot behavior? - Examples: Add a new library class, move a module to a different repo, call a function in a new library class in a pre-existing module, ... - [ ] Includes tests? - **Tests** - Does the change include any explicit test code? - Examples: Unit tests, integration tests, robot tests, ... - [ ] Includes documentation? - **Documentation** - Does the change contain explicit documentation additions outside direct code modifications (and comments)? - Examples: Update readme file, add feature readme file, link to documentation on an a separate Web page, ... ## How This Was Tested - CodeQL locally and in CI. - MdeModulePkg build and CI. ## Integration Instructions N/A
- Loading branch information