diff options
author | Matt Caswell <matt@openssl.org> | 2016-10-31 12:48:37 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-11-09 09:10:29 +0000 |
commit | 9529419d943c9c4cedd2397f78902c53b3091be1 (patch) | |
tree | d85fc9bb3b965b02686b6905022013a3aa7269ee | |
parent | 4bfe1432c8d82ffaa99c01085da0520b6090567d (diff) | |
download | openssl-9529419d943c9c4cedd2397f78902c53b3091be1.zip openssl-9529419d943c9c4cedd2397f78902c53b3091be1.tar.gz openssl-9529419d943c9c4cedd2397f78902c53b3091be1.tar.bz2 |
Fix a memory leak in the ClientHello extension parsing
We should be freeing up the raw extension data after we've finished with it.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
-rw-r--r-- | ssl/statem/statem_srvr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index c7841ac..ca7f5af 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -907,6 +907,8 @@ MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt) * structure. */ + memset(&clienthello, 0, sizeof(clienthello)); + clienthello.isv2 = RECORD_LAYER_is_sslv2_record(&s->rlayer); PACKET_null_init(&cookie); @@ -1423,6 +1425,7 @@ MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt) } sk_SSL_CIPHER_free(ciphers); + OPENSSL_free(clienthello.pre_proc_exts); return MSG_PROCESS_CONTINUE_PROCESSING; f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); @@ -1430,6 +1433,7 @@ MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt) ossl_statem_set_error(s); sk_SSL_CIPHER_free(ciphers); + OPENSSL_free(clienthello.pre_proc_exts); return MSG_PROCESS_ERROR; } |