Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Valid

Function `getActivePlayerIndex` will return wrong value if parameter is invalid.

Summary

Function getActivePlayerIndex will return wrong value if parameter is either address(0) or address that is not in the players array.

Vulnerability Details

If the parameter player is address(0) or address that is not in the players array, the function will return 0. This will be invalid because the player at index 0 is different.

Impact

Wrong return value.

Tools Used

Manual Review

Recommendations

I think the best solution for this will be to return index that is outside of the array

- return 0;
+ return players.length;
Updates

Lead Judging Commences

Hamiltonite Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

getActivePlayerIndex can say a player is both entered at slot 0 and inactive

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.