The _getBeneficiaryIndex function loops through the beneficiaries array and returns the index of the _beneficiary. However, if _beneficiary is not found, _index remains uninitialized and defaults to 0, which could lead to incorrect behavior.
If the _beneficiary address is not found in the beneficiaries array, the function will return 0, which could be misinterpreted as the first index (valid index) rather than indicating that the beneficiary does not exist.
Incorrect beneficiary identification
Incorrect return value
Manual review
Fixed code:
Alternative we could use revert instead of return type(uint256).max;.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.