Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for loop index out of bounds error #966

Merged
merged 1 commit into from Jun 19, 2021

Conversation

fysiks1
Copy link
Contributor

@fysiks1 fysiks1 commented Jun 19, 2021

Fixes an index out of bounds error when refreshMenus() and subsequently findAdminsWithMenu() is called when there is 32 players in the server. Indexing the playersList array in the for loop condition causes it to try to index with a value of 32 on the very last condition check which is not valid for this array.

Fixes an index out of bounds error when refreshMenus() and subsequently findAdminsWithMenu() is called when there is 32 players in the server. Indexing the playersList array in the for loop condition causes it to try to index with a value of 32 on the very last condition check which is not valid for this array.
@fysiks1
Copy link
Contributor Author

fysiks1 commented Jun 19, 2021

I imagine that this could be eligible for 1.9-dev.

@Arkshine
Copy link
Member

Thanks!

@Arkshine Arkshine merged commit 7fef58c into alliedmodders:master Jun 19, 2021
@fysiks1 fysiks1 deleted the fix_restmenu_for_loop_bug branch June 19, 2021 18:13
@fysiks1
Copy link
Contributor Author

fysiks1 commented Jun 19, 2021

Any chance this can be applied to 1.9-dev since it's a bug fix?

Arkshine pushed a commit that referenced this pull request Jun 19, 2021
Fixes an index out of bounds error when refreshMenus() and subsequently findAdminsWithMenu() is called when there is 32 players in the server. Indexing the playersList array in the for loop condition causes it to try to index with a value of 32 on the very last condition check which is not valid for this array.
@dvander
Copy link
Member

dvander commented Jun 20, 2021

Sure, just submit a PR against the 1.9 branch.

@WPMGPRoSToTeMa
Copy link
Contributor

WPMGPRoSToTeMa commented Jun 20, 2021

Sure, just submit a PR against the 1.9 branch.

Note that it was already cherry-picked into 1.9-dev. 8e902cb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants