[openssl-commits] [openssl] master update

Andy Polyakov appro at openssl.org
Wed Apr 18 18:08:46 UTC 2018


The branch master has been updated
       via  b3199e54d65f25c5ef6e54e129e228831a1fb363 (commit)
      from  f3d3b362553d95047d93608edd15d20aa6e6e0fd (commit)


- Log -----------------------------------------------------------------
commit b3199e54d65f25c5ef6e54e129e228831a1fb363
Author: Andy Polyakov <appro at openssl.org>
Date:   Tue Apr 17 21:30:22 2018 +0200

    apps/s_socket.c: fix memory sanitizer problem in ACCEPT printout.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5994)

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

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

diff --git a/apps/s_socket.c b/apps/s_socket.c
index d21bfc6..69f0f4f 100644
--- a/apps/s_socket.c
+++ b/apps/s_socket.c
@@ -211,7 +211,7 @@ int do_server(int *accept_sock, const char *host, const char *port,
     int i;
     BIO_ADDRINFO *res = NULL;
     const BIO_ADDRINFO *next;
-    int sock_family, sock_type, sock_protocol;
+    int sock_family, sock_type, sock_protocol, sock_port;
     const BIO_ADDR *sock_address;
     int sock_options = BIO_SOCK_REUSEADDR;
     int ret = 0;
@@ -280,10 +280,12 @@ int do_server(int *accept_sock, const char *host, const char *port,
     }
 #endif
 
+    sock_port = BIO_ADDR_rawport(sock_address);
+
     BIO_ADDRINFO_free(res);
     res = NULL;
 
-    if (BIO_ADDR_rawport(sock_address) == 0) {
+    if (sock_port == 0) {
         /* dynamically allocated port, report which one */
         union BIO_sock_info_u info;
         char *hostname = NULL;


More information about the openssl-commits mailing list