From: Aki Tuomi Date: Thu, 7 Jul 2022 10:58:02 +0000 (+0300) Subject: login-common: Handle missing ssl_iostream in get_var_expand_table() X-Git-Tag: 2.3.21~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4c06fee481a6cb5a2f0fa9711bc9c889e4375bf9;p=thirdparty%2Fdovecot%2Fcore.git login-common: Handle missing ssl_iostream in get_var_expand_table() It can be missing during connection disconnection when connection is lost uncleanly. --- 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);