We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CvxLocker.findEpochId
cmichel
It's unclear why the binary search algorithm stops after 128 iterations.
128
It might not return the actual epoch id (although very unlikely as 128 iterations should be sufficient.)
Use a while (max > min) loop instead of the for loop with a fixed number of iterations.
while (max > min)
for
uint256 mid = (min + max + 1) / 2; is also not using safe math.
uint256 mid = (min + max + 1) / 2;
The text was updated successfully, but these errors were encountered:
cmichel issue #53
84132e6
No branches or pull requests
Handle
cmichel
Vulnerability details
Vulnerability Details
It's unclear why the binary search algorithm stops after
128
iterations.Impact
It might not return the actual epoch id (although very unlikely as 128 iterations should be sufficient.)
Recommended Mitigation Steps
Use a
while (max > min)
loop instead of thefor
loop with a fixed number of iterations.uint256 mid = (min + max + 1) / 2;
is also not using safe math.The text was updated successfully, but these errors were encountered: