cooljeanius / trousers-0.3.11.2

forked from Sourceforge to get it working on OSX
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Fix code scanning alert no. 2: Comparison of narrow type with wide type in loop condition #12

Closed cooljeanius closed 3 weeks ago

cooljeanius commented 3 weeks ago

Fixes https://github.com/cooljeanius/trousers-0.3.11.2/security/code-scanning/2

To fix the problem, we need to ensure that the variable i is of a type that is at least as wide as the type of select->sizeOfSelect. The best way to achieve this is to change the type of i from UINT16 to UINT32. This change will prevent any potential overflow issues and ensure that the comparison is valid.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.