The performUpkeep function assumes that the length of the decoded splittersToCall array matches the length of the accounts array (which is used in the loop). If these lengths don't match, it could lead to out-of-bounds access or missed elements.
In the given function:
The issue arises from the relationship between splittersToCall and accounts:
splittersToCall is created by decoding _performData.
The loop iterates over the length of splittersToCall.
Inside the loop, accounts[i] is accessed.
The function assumes that splittersToCall.length and accounts.length are the same. However, there's no explicit check to ensure this.
If splittersToCall.length is greater than accounts.length:
When i becomes equal to accounts.length, but is still less than splittersToCall.length, the loop will continue.
This will cause accounts[i] to access an out-of-bounds index, potentially causing a runtime error.
When splittersToCall.length is less than accounts.length:
The loop will terminate before all accounts have been considered.
This means some accounts that should be processed will be missed.
Manual review
Add a check that ensures that the lengths match before proceeding with the loop:
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.