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.4.0~3762 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6adb7cbedfda9a88cbde89bb7bb49ad1f58a69d3;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 0992a959cd..b33c2d6883 100644 --- a/src/login-common/client-common.c +++ b/src/login-common/client-common.c @@ -891,7 +891,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"; @@ -902,6 +902,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);