You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The giveLoan function, in charge of allowing lenders to transfer loan (loanIds) to give to a respective pool (poolIds), simultaneously iterates over both arrays based on the length of just one of them (loanIds). If the number of elements in poolIds is less than that in loanIds, the whole transaction will be reverted for attempting to access an out-of-bounds index.
The whole transaction will be reverted
Recommendations
Consider including a require clause with an explicit error message to check for matching array length.
The text was updated successfully, but these errors were encountered:
Input arrays with mismatched length will make giveLoan to throw
Severity
Low Risk
Relevant GitHub Links
https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L359
The
giveLoan
function, in charge of allowing lenders to transfer loan (loanIds) to give to a respective pool (poolIds), simultaneously iterates over both arrays based on the length of just one of them (loanIds). If the number of elements in poolIds is less than that in loanIds, the whole transaction will be reverted for attempting to access an out-of-bounds index.The whole transaction will be reverted
Recommendations
Consider including a require clause with an explicit error message to check for matching array length.
The text was updated successfully, but these errors were encountered: