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 OOB access #332

Merged
merged 1 commit into from
Jan 4, 2025
Merged

Conversation

samisalreadytaken
Copy link

When the loop fails its i < 48 condition, it will access out of array bounds on GetWeapon right after. This was mostly benign because CHandle m_hMyWeapons[48] is followed by CHandle m_hActiveWeapon in memory, so m_hMyWeapons[48] would access m_hActiveWeapon, which would always be null because the entity can't have an active weapon with no weapons.


PR Checklist

  • My PR follows all guidelines in the CONTRIBUTING.md file
  • My PR targets a develop branch OR targets another branch with a specific goal in mind

@Blixibon Blixibon merged commit de59834 into mapbase-source:develop Jan 4, 2025
4 checks passed
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.

2 participants