From c7c4377600bbe4ccb2a10c9ac4120b001fe678ca Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 17 Dec 2010 22:30:47 +0000 Subject: [PATCH] - clamp parameter to P_GiveBody to prevent overflows. SVN r3058 (trunk) --- src/g_shared/a_pickups.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index baa37d56c..f15da2f3a 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -184,6 +184,7 @@ bool P_GiveBody (AActor *actor, int num) int max; player_t *player = actor->player; + num = clamp(num, -65536, 65536); // prevent overflows for bad values if (player != NULL) { max = static_cast(actor)->GetMaxHealth() + player->stamina;