The _getBeneficiaryIndex()
function does not reliably return the index of the beneficiary, as it lacks a proper return statement in all code paths.
If the _beneficiary
is not found in the array, the function does not explicitly return a value. This can lead to unexpected behavior, as Solidity will return the default value for uint256
(i.e., 0
), which might be misinterpreted as a valid index.
If _getBeneficiaryIndex()
returns 0
for a non-existent beneficiary, it might incorrectly reference the first element in the array.
Manual code review
Fix _getBeneficiaryIndex
to Handle Missing Beneficiaries
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.