From 5fcfd88fb61b4aa2cc0489193521b3f3d000fd3f Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 19 Mar 2023 15:32:41 +0200 Subject: [PATCH 18/18] is_action_possible(): Fix NULL dereference on ACTION_HEAL_UNIT check See osdn #47603 Signed-off-by: Marko Lindqvist --- common/actions.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/actions.c b/common/actions.c index 30cd58fc2c..c8496f488f 100644 --- a/common/actions.c +++ b/common/actions.c @@ -4110,6 +4110,9 @@ is_action_possible(const action_id wanted_action, case ACTRES_HEAL_UNIT: /* Reason: It is not the healthy who need a doctor, but the sick. */ /* Info leak: the actor can see the target's HP. */ + if (!can_see_tgt_unit) { + return TRI_MAYBE; + } if (!(target->unit->hp < target->unittype->hp)) { return TRI_NO; } -- 2.39.2