From: eaglegai <31752768+eaglegai@users.noreply.github.com> Date: Tue, 21 Jan 2025 14:47:51 +0000 (+0800) Subject: check before use daemon->shm_info (#1229) X-Git-Tag: release-1.23.0rc1~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=073c7301ebdf7511320ec817ad7ecacf6b45c4be;p=thirdparty%2Funbound.git check before use daemon->shm_info (#1229) fix core after the command `unbound-control stop unbound` fix:https://github.com/NLnetLabs/unbound/issues/1228 Signed-off-by: eaglegai --- diff --git a/util/shm_side/shm_main.c b/util/shm_side/shm_main.c index 6fd1f5ea6..751d6d649 100644 --- a/util/shm_side/shm_main.c +++ b/util/shm_side/shm_main.c @@ -195,7 +195,7 @@ void shm_main_shutdown(struct daemon* daemon) { #ifdef HAVE_SHMGET /* web are OK, just disabled */ - if(!daemon->cfg->shm_enable) + if(!daemon->cfg->shm_enable || !daemon->shm_info) return; verbose(VERB_DETAIL, "SHM shutdown - KEY [%d] - ID CTL [%d] ARR [%d] - PTR CTL [%p] ARR [%p]",