mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
Fix potential OOB memory access if the player's curr_weapon member is set out of range from CON
git-svn-id: https://svn.eduke32.com/eduke32@7485 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0edbd45145
commit
5ac5a2ad3c
1 changed files with 3 additions and 4 deletions
|
@ -3458,12 +3458,11 @@ void P_SelectNextInvItem(DukePlayer_t *pPlayer)
|
|||
|
||||
void P_CheckWeapon(DukePlayer_t *pPlayer)
|
||||
{
|
||||
int playerNum;
|
||||
int weaponNum;
|
||||
|
||||
if (pPlayer->reloading)
|
||||
if (pPlayer->reloading || (unsigned)pPlayer->curr_weapon >= MAX_WEAPONS)
|
||||
return;
|
||||
|
||||
int playerNum, weaponNum;
|
||||
|
||||
if (pPlayer->wantweaponfire >= 0)
|
||||
{
|
||||
weaponNum = pPlayer->wantweaponfire;
|
||||
|
|
Loading…
Reference in a new issue