From: Ralph Boehme Date: Wed, 25 Jul 2018 18:02:23 +0000 (+0200) Subject: smbd: don't client->connections without checking client != NULL first in exit_server_... X-Git-Tag: ldb-1.5.0~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e711d18c8e9953aca2ca64179c3d0b305a41c62;p=thirdparty%2Fsamba.git smbd: don't client->connections without checking client != NULL first in exit_server_common() exit_server_common() can be called also in smbd processes without a smbXsrv_client structure, e.g. the parent or some background tasks. Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Thu Jul 26 01:29:38 CEST 2018 on sn-devel-144 --- diff --git a/source3/smbd/server_exit.c b/source3/smbd/server_exit.c index 149cd863505..cc8ea18aeda 100644 --- a/source3/smbd/server_exit.c +++ b/source3/smbd/server_exit.c @@ -96,6 +96,7 @@ static void exit_server_common(enum server_exit_reason how, if (client != NULL) { sconn = client->sconn; + xconn = client->connections; } if (!exit_firsttime) @@ -108,7 +109,7 @@ static void exit_server_common(enum server_exit_reason how, /* * Here we typically have just one connection */ - for (xconn = client->connections; xconn != NULL; xconn = xconn_next) { + for (; xconn != NULL; xconn = xconn_next) { xconn_next = xconn->next; DLIST_REMOVE(client->connections, xconn);