Skip to content
New issue

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

M-01 MitigationConfirmed #9

Open
code423n4 opened this issue Jul 18, 2023 · 2 comments
Open

M-01 MitigationConfirmed #9

code423n4 opened this issue Jul 18, 2023 · 2 comments
Labels
confirmed for report This issue is confirmed for report mitigation-confirmed MR-M-01 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@code423n4
Copy link
Contributor

Lines of code

Vulnerability details

Previously, the case when the passed in x value is smaller than the first value of the passed in array of x values (i.e. x < xArray[0]) was not handled because of the implicit assumption that this never happens. There is now an explicit check for this scenario and the first value of the array of y values is returned, which is the correct thing to do in this situation:

if (indexLowerBound == 0 && x < xArray[0]) return yArray[0];

Therefore, this situation is now properly handled and no longer reverts, i.e. the issue is fixed.

Note that there would be potential for gas optimizations: The check x < xArray[0] would be sufficient (as this implies indexLowerBound == 0) and the check could be performed before calling findLowerBound. However, because this is an edge case that depends on a particular configuration, the optimization may not be worth it.

@c4-judge
Copy link

hansfriese marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Jul 22, 2023
@c4-judge
Copy link

hansfriese marked the issue as confirmed for report

@c4-judge c4-judge added the confirmed for report This issue is confirmed for report label Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed for report This issue is confirmed for report mitigation-confirmed MR-M-01 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

2 participants