From cc3b204e5abe18c171a2ecb09d22d48011dc8e03 Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Mon, 13 Mar 2017 14:28:06 +0100 Subject: [PATCH] Add a missing sanity check. attacker->classname may be NULL. This was reported by maraakate in issue #170. --- src/g_combat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_combat.c b/src/g_combat.c index 3bf5392..7b1592f 100644 --- a/src/g_combat.c +++ b/src/g_combat.c @@ -127,7 +127,7 @@ Killed(edict_t *targ, edict_t *inflictor, edict_t *attacker, } /* medics won't heal monsters that they kill themselves */ - if (strcmp(attacker->classname, "monster_medic") == 0) + if (attacker && attacker->classname && strcmp(attacker->classname, "monster_medic") == 0) { targ->owner = attacker; }