Skip to content
Snippets Groups Projects
Commit 9b73ec4d authored by Matthias Sohn's avatar Matthias Sohn
Browse files

Fix "Comparison of narrow type with wide type in loop condition"

This issue was detected by a GitHub CodeQL security scan run on JGit
source code.

Description of the error raised by the security scan:
"In a loop condition, comparison of a value of a narrow type with a
value of a wide type may always evaluate to true if the wider value is
sufficiently large (or small). This is because the narrower value may
overflow. This can lead to an infinite loop."

Fix this by using type `long` for the local variable `done`.

Change-Id: Ibd4f71299e3f2e40d4331227bd143569a4264d8c
parent d3a5637d
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment