From 634b0aef28ea40fbe0d3f04b79a51cb8e341ecfb Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 19 Mar 2023 15:29:19 +0200 Subject: [PATCH 12/12] 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 7390d48162..22d995a1bb 100644 --- a/common/actions.c +++ b/common/actions.c @@ -2584,6 +2584,9 @@ is_action_possible(const action_id wanted_action, case ACTION_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