From 4c06fee481a6cb5a2f0fa9711bc9c889e4375bf9 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Thu, 7 Jul 2022 13:58:02 +0300 Subject: [PATCH] login-common: Handle missing ssl_iostream in get_var_expand_table() It can be missing during connection disconnection when connection is lost uncleanly. --- src/login-common/client-common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/login-common/client-common.c b/src/login-common/client-common.c index c6f6a16cff..24892f5fa9 100644 --- a/src/login-common/client-common.c +++ b/src/login-common/client-common.c @@ -866,7 +866,7 @@ get_var_expand_table(struct client *client) } else if (client->proxied_ssl) { tab[11].value = "TLS"; tab[12].value = "(proxied)"; - } else { + } else if (client->ssl_iostream != NULL) { const char *ssl_state = ssl_iostream_is_handshaked(client->ssl_iostream) ? "TLS" : "TLS handshaking"; @@ -877,6 +877,9 @@ get_var_expand_table(struct client *client) t_strdup_printf("%s: %s", ssl_state, ssl_error); tab[12].value = ssl_iostream_get_security_string(client->ssl_iostream); + } else { + tab[11].value = "TLS"; + tab[12].value = ""; } tab[13].value = client->mail_pid == 0 ? "" : dec2str(client->mail_pid); -- 2.47.3