]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
check before use daemon->shm_info (#1229)
authoreaglegai <31752768+eaglegai@users.noreply.github.com>
Tue, 21 Jan 2025 14:47:51 +0000 (22:47 +0800)
committerGitHub <noreply@github.com>
Tue, 21 Jan 2025 14:47:51 +0000 (15:47 +0100)
fix core after the command `unbound-control stop unbound`

fix:https://github.com/NLnetLabs/unbound/issues/1228

Signed-off-by: eaglegai <eaglegai@163.com>
util/shm_side/shm_main.c

index 6fd1f5ea638c695ea2c16b0aa54bee2670b42c0f..751d6d649bc4c4073b96897887db58d4b63d6540 100644 (file)
@@ -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]",