From 126c76ea28bd42293a04f50e9ee9dc67167e52dd Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 5 Jun 2022 08:39:42 +0300 Subject: [PATCH 35/35] Fix NULL deference when the unit does not exist in handle_unit_actions() Reported anonymously See osdn #44757 Signed-off-by: Marko Lindqvist --- client/packhand.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/packhand.c b/client/packhand.c index f8f5cc273a..6d99c8dba5 100644 --- a/client/packhand.c +++ b/client/packhand.c @@ -964,8 +964,8 @@ void handle_city_info(const struct packet_city_info *packet) /* Update the panel text (including civ population). */ update_info_label(); - - /* update caravan dialog */ + + /* Update caravan dialog */ if ((production_changed || shield_stock_changed) && action_selection_target_city() == pcity->id) { dsend_packet_unit_get_actions(&client.conn, @@ -5025,7 +5025,8 @@ void handle_unit_actions(const struct packet_unit_actions *packet) case REQEST_BACKGROUND_REFRESH: /* This was a background action selection dialog refresh. */ - if (action_selection_actor_unit() == actor_unit->id) { + if (actor_unit != NULL + && action_selection_actor_unit() == actor_unit->id) { /* The situation may have changed. */ action_selection_refresh(actor_unit, target_city, target_unit, -- 2.35.1