commit 0aceb964947aa13b4e9b120c66ef93e8706d7025
Author: Johan Mattsson <39247600+mjunix@users.noreply.github.com>
AuthorDate: Sat Apr 1 10:59:15 2023 +0200
Commit: GitHub <noreply@github.com>
CommitDate: Sat Apr 1 10:59:15 2023 +0200
Fix potential index out of bounds
---
src/heretic/p_inter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/heretic/p_inter.c b/src/heretic/p_inter.c
index bfb5eeb4..cf75a7db 100644
--- a/src/heretic/p_inter.c
+++ b/src/heretic/p_inter.c
@@ -156,7 +156,7 @@ boolean P_GiveAmmo(player_t * player, ammotype_t ammo, int count)
{
return (false);
}
- if ((unsigned int) ammo > NUMAMMO)
+ if ((unsigned int) ammo >= NUMAMMO)
{
I_Error("P_GiveAmmo: bad type %i", ammo);
}