]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
kdc-heimdal: avoid NULL dereference when task is NULL master
authorDaniil Sarafannikov <sarafannikovda@sgu.ru>
Thu, 11 Jun 2026 13:56:45 +0000 (17:56 +0400)
committerAnoop C S <anoopcs@samba.org>
Fri, 19 Jun 2026 08:22:25 +0000 (08:22 +0000)
kdc_post_fork() may be called with NULL task pointer leading to a
call of task_server_terminate() with NULL pointer, where it will
be dereferenced.

Add an explicit NULL check and instead of attempting to terminate
a NULL task, log the error and return.

Pair-Programmed-With: Timofei Fedotov <sovtouch@altlinux.org>
Signed-off-by: Daniil Sarafannikov <sarafannikovda@sgu.ru>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Jun 19 08:22:25 UTC 2026 on atb-devel-224

source4/kdc/kdc-heimdal.c

index 978de7a8caf0d0b4d44b054b9d5e61a74af26d33..df58f947e7280c6039e2d4987844a35376f54b7c 100644 (file)
@@ -334,7 +334,7 @@ static void kdc_post_fork(struct task_server *task, struct process_details *pd)
        int ldb_ret;
 
        if (task == NULL) {
-               task_server_terminate(task, "kdc: Null task", true);
+               DBG_ERR("kdc_post_fork: Null task\n");
                return;
        }
        if (task->private_data == NULL) {