From c63273348a7036dfa5a48a2b428e1b958bebe5cf Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 12 May 2013 18:31:36 +0000 Subject: [PATCH] - Fixed possible NULL pointer deref in A_CustomPunch SVN r4255 (trunk) --- src/thingdef/thingdef_codeptr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 5cf413693d..95fc1639e7 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1409,7 +1409,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch) if (LifeSteal) P_GiveBody (self, (Damage * LifeSteal) >> FRACBITS); - S_Sound (self, CHAN_WEAPON, weapon->AttackSound, 1, ATTN_NORM); + if (weapon != NULL) + { + S_Sound (self, CHAN_WEAPON, weapon->AttackSound, 1, ATTN_NORM); + } self->angle = R_PointToAngle2 (self->x, self->y,