commit 7d4b47a71243da03d5e0588eaf6d3e2f401bfbc8
Author: Johan Mattsson <39247600+mjunix@users.noreply.github.com>
AuthorDate: Sat Apr 1 10:57:15 2023 +0200
Commit: GitHub <noreply@github.com>
CommitDate: Sat Apr 1 10:57:15 2023 +0200
Fix potential index out of bounds
---
src/strife/p_inter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/strife/p_inter.c b/src/strife/p_inter.c
index b8efad82..bf36cb14 100644
--- a/src/strife/p_inter.c
+++ b/src/strife/p_inter.c
@@ -71,7 +71,7 @@ boolean P_GiveAmmo(player_t* player, ammotype_t ammo, int num)
if(ammo == am_noammo)
return false;
- if(ammo > NUMAMMO)
+ if(ammo >= NUMAMMO)
I_Error ("P_GiveAmmo: bad type %i", ammo);
if(player->ammo[ammo] == player->maxammo[ammo])