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

getActivePlayerIndex can return incorrect value

Summary

getActivePlayerIndex can return incorrect zero value

Vulnerability Details

zero is a valid array index, therefore returning zero is not a good way to indicate that the player is not active.

Impact

zero will be returned if a player does not exist in the array, but zero is a valid array index so the person calling the function will think it's active

Tools Used

VSCode

Recommendations

the function should return -1 or revert if the player is not active. if returning -1, the return value should be a signed integer.

Updates

Lead Judging Commences

Hamiltonite Lead Judge about 2 years 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.

Give us feedback!