dovecot-1.0: If SSL function fails and there are no errors, retu...

dovecot at dovecot.org dovecot at dovecot.org
Wed May 7 22:44:44 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.0/rev/43785ad99523
changeset: 5549:43785ad99523
user:      Timo Sirainen <tss at iki.fi>
date:      Wed May 07 22:44:41 2008 +0300
description:
If SSL function fails and there are no errors, return "Unknown error"
instead of "Success" as the reason.

diffstat:

1 file changed, 5 insertions(+), 2 deletions(-)
src/login-common/ssl-proxy-openssl.c |    7 +++++--

diffs (17 lines):

diff -r c706bfebc76e -r 43785ad99523 src/login-common/ssl-proxy-openssl.c
--- a/src/login-common/ssl-proxy-openssl.c	Wed Apr 30 20:22:57 2008 +0300
+++ b/src/login-common/ssl-proxy-openssl.c	Wed May 07 22:44:41 2008 +0300
@@ -307,8 +307,11 @@ static const char *ssl_last_error(void)
 	size_t err_size = 256;
 
 	err = ERR_get_error();
-	if (err == 0)
-		return strerror(errno);
+	if (err == 0) {
+		if (errno != 0)
+			return strerror(errno);
+		return "Unknown error";
+	}
 
 	buf = t_malloc(err_size);
 	buf[err_size-1] = '\0';


More information about the dovecot-cvs mailing list