Avoid leaking peername data via accept BIOs
authorViktor Dukhovni <openssl-users@dukhovni.org>
Fri, 9 Feb 2018 23:34:33 +0000 (18:34 -0500)
committerViktor Dukhovni <openssl-users@dukhovni.org>
Sat, 10 Feb 2018 02:08:17 +0000 (21:08 -0500)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit 4e0752535eb87b9aab4cf193f4422b5801ab7b32)

crypto/bio/bss_acpt.c

index f0fe7f0a8ef53c46f498ce1df7f3cf628cc7ee52..4be4781d550b1350e51c48552a3419c0e983916d 100644 (file)
@@ -271,6 +271,11 @@ static int acpt_state(BIO *b, BIO_ACCEPT *c)
             BIO_clear_retry_flags(b);
             b->retry_reason = 0;
 
+            OPENSSL_free(c->cache_peer_name);
+            c->cache_peer_name = NULL;
+            OPENSSL_free(c->cache_peer_serv);
+            c->cache_peer_serv = NULL;
+
             s = BIO_accept_ex(c->accept_sock, &c->cache_peer_addr,
                               c->accepted_mode);