From 4f45828ff3de2952fa2d6be8515e67986213e7a8 Mon Sep 17 00:00:00 2001 From: Janik Rabe Date: Wed, 18 Jul 2018 21:12:38 +0300 Subject: [PATCH] Keep errstr set to NULL if errno is not set Don't use errno if it is not set and show the default error message instead. This prevents messages like "SSL handshake failed: Success" from being shown. --- src/core/network-openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/network-openssl.c b/src/core/network-openssl.c index 692c7e71..95697135 100644 --- a/src/core/network-openssl.c +++ b/src/core/network-openssl.c @@ -842,7 +842,7 @@ int irssi_ssl_handshake(GIOChannel *handle) return -1; case SSL_ERROR_SYSCALL: errstr = ERR_reason_error_string(ERR_get_error()); - if (errstr == NULL && ret == -1) + if (errstr == NULL && ret == -1 && errno) errstr = strerror(errno); g_warning("SSL handshake failed: %s", errstr != NULL ? errstr : "server closed connection unexpectedly"); return -1;