From 8bd5588b69886fe3ff594f6a30a83d09ed56e422 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 20 Jun 2022 17:51:03 +0300 Subject: [PATCH 47/47] Handle fatal tileset load failure on FREECIV_NDEBUG builds Handle the failure with regular check, not with fc_assert_exit_msg(). The old code allowed execution on FREECIV_NDEBUG builds to continue to segfault on the next use of NULL tileset pointer. See osdn #44754 Signed-off-by: Marko Lindqvist --- client/tilespec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/tilespec.c b/client/tilespec.c index cf1ff8f159..6ef695733d 100644 --- a/client/tilespec.c +++ b/client/tilespec.c @@ -1372,9 +1372,8 @@ bool tilespec_reread(const char *new_tileset_name, new_tileset_in_use = FALSE; if (!(tileset = tileset_read_toplevel(old_name, FALSE, -1, scale))) { - /* Always fails. */ - fc_assert_exit_msg(NULL != tileset, - "Failed to re-read the currently loaded tileset."); + log_fatal("Failed to re-read the currently loaded tileset."); + exit(EXIT_FAILURE); } } tileset_load_tiles(tileset); -- 2.35.1