M-01 MitigationConfirmed #9
Labels
confirmed for report
This issue is confirmed for report
mitigation-confirmed
MR-M-01
satisfactory
satisfies C4 submission criteria; eligible for awards
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: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 impliesindexLowerBound == 0
) and the check could be performed before callingfindLowerBound
. However, because this is an edge case that depends on a particular configuration, the optimization may not be worth it.The text was updated successfully, but these errors were encountered: