From e8d8e67b56b1214a648a89f0b6d5db26c3c2824f Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 12 May 2013 18:36:03 +0000 Subject: [PATCH] - Fixed possible NULL pointer deref in P_SpawnPlayerMissile(). SVN r4257 (trunk) --- src/p_mobj.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index c22430af2..a6391a71b 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -5634,7 +5634,11 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, AActor *defaultobject = GetDefaultByType(type); int vrange = nofreeaim ? ANGLE_1*35 : 0; - if (source && source->player && source->player->ReadyWeapon && (source->player->ReadyWeapon->WeaponFlags & WIF_NOAUTOAIM)) + if (source == NULL) + { + return NULL; + } + if (source->player && source->player->ReadyWeapon && (source->player->ReadyWeapon->WeaponFlags & WIF_NOAUTOAIM)) { // Keep exactly the same angle and pitch as the player's own aim an = angle;