]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-proxy: Fix potential crash if ssl_iostream_handshake() fails
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sat, 14 Sep 2019 09:59:06 +0000 (12:59 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 28 Oct 2019 12:39:31 +0000 (12:39 +0000)
The error was uninitialized, which could have caused a crash when it was
logged (or just "(null)" printed with better luck).

src/login-common/login-proxy.c

index 717481672eeafa0e0235864143bc8f744bf67e10..1888060731d3e8a1df221178675e9ec54804e251 100644 (file)
@@ -719,7 +719,8 @@ int login_proxy_starttls(struct login_proxy *proxy)
                error = ssl_iostream_get_last_error(proxy->server_ssl_iostream);
                client_log_err(proxy->client, t_strdup_printf(
                        "proxy: Failed to start SSL handshake to %s:%u: %s",
-                       net_ip2addr(&proxy->ip), proxy->port, error));
+                       net_ip2addr(&proxy->ip), proxy->port,
+                       ssl_iostream_get_last_error(proxy->server_ssl_iostream)));
                return -1;
        }