]> 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>
Mon, 21 Aug 2023 07:33:50 +0000 (07:33 +0000)
It can be missing during connection disconnection when connection
is lost uncleanly.

src/login-common/client-common.c

index c6f6a16cff1d4921bc1fba91aae67a57e7872adb..24892f5fa976ed3b7ed08220105deb8f2f935998 100644 (file)
@@ -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);