]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Handle missing ssl_iostream in get_var_expand_table()
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 7 Jul 2022 10:58:02 +0000 (13:58 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 15 Jul 2022 08:33:21 +0000 (08:33 +0000)
It can be missing during connection disconnection when connection
is lost uncleanly.

src/login-common/client-common.c

index 0992a959cd9e928a28748c70fe4087d4a6bc9cad..b33c2d6883c9d4394aee4b40c0ea7697dc238cc7 100644 (file)
@@ -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);