[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Wed May 4 09:19:06 UTC 2016


The branch master has been updated
       via  ea837d79f91f481d7b07ea7a985b35c24e9dcc79 (commit)
      from  1697a81bafcc9a65012b62ba01c1661bf40e5edb (commit)


- Log -----------------------------------------------------------------
commit ea837d79f91f481d7b07ea7a985b35c24e9dcc79
Author: Matt Caswell <matt at openssl.org>
Date:   Wed May 4 09:12:27 2016 +0100

    Remove stale errors from early connection attempts in a client
    
    The init_client() function in the apps sets up the client connection. It
    may try multiple addresses until it finds one that works. We should clear
    the error queue if we eventually get a successful connection because
    otherwise we get stale errors hanging around. This can cause problems in
    subsequent calls to SSL_get_error(), i.e. non-fatal NBIO events appear as
    fatal.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 apps/s_socket.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/apps/s_socket.c b/apps/s_socket.c
index 4653217..6d77d82 100644
--- a/apps/s_socket.c
+++ b/apps/s_socket.c
@@ -195,6 +195,8 @@ int init_client(int *sock, const char *host, const char *port,
     if (*sock == INVALID_SOCKET) {
         ERR_print_errors(bio_err);
     } else {
+        /* Remove any stale errors from previous connection attempts */
+        ERR_clear_error();
         ret = 1;
     }
     BIO_ADDRINFO_free(res);


More information about the openssl-commits mailing list