]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
If SSL function fails and there are no errors, return "Unknown error"
authorTimo Sirainen <tss@iki.fi>
Wed, 7 May 2008 19:44:45 +0000 (22:44 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 7 May 2008 19:44:45 +0000 (22:44 +0300)
instead of "Success" as the reason.

--HG--
branch : HEAD

src/login-common/ssl-proxy-openssl.c

index 47ce23f2b8e14eaafd74787e7711d6fd99245573..089a2f64989478d8c5bc462577ceda5aa682447d 100644 (file)
@@ -309,8 +309,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';