[openssl-commits] [openssl] OpenSSL source code branch OpenSSL_1_0_2-stable updated. OpenSSL_1_0_2-beta3-100-gd04a1e0

Matt Caswell matt at openssl.org
Sat Dec 13 00:15:29 UTC 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenSSL source code".

The branch, OpenSSL_1_0_2-stable has been updated
       via  d04a1e0b5beb3329cdf8c4ec35b9113cbc41d2f2 (commit)
       via  bb1ddd3d9a0d01656b90693a214b911995a5fe8c (commit)
      from  6806b69084fc0a800cf33787568c517a21ebc2c3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d04a1e0b5beb3329cdf8c4ec35b9113cbc41d2f2
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Dec 12 11:05:21 2014 +0000

    Fix memory leak in s2_srvr.c if BUF_MEM_grow fails
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    Reviewed-by: Kurt Roeckx <kurt at openssl.org>

commit bb1ddd3d9a0d01656b90693a214b911995a5fe8c
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Dec 12 11:03:00 2014 +0000

    Fixed memory leak if BUF_MEM_grow fails
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    Reviewed-by: Kurt Roeckx <kurt at openssl.org>

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

Summary of changes:
 ssl/d1_srvr.c  |    1 +
 ssl/s23_srvr.c |    1 +
 ssl/s2_srvr.c  |   22 +++++++++++++++-------
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c
index 0841183..5f15467 100644
--- a/ssl/d1_srvr.c
+++ b/ssl/d1_srvr.c
@@ -251,6 +251,7 @@ int dtls1_accept(SSL *s)
 					}
 				if (!BUF_MEM_grow(buf,SSL3_RT_MAX_PLAIN_LENGTH))
 					{
+					BUF_MEM_free(buf);
 					ret= -1;
 					goto end;
 					}
diff --git a/ssl/s23_srvr.c b/ssl/s23_srvr.c
index e656ac2..9840d47 100644
--- a/ssl/s23_srvr.c
+++ b/ssl/s23_srvr.c
@@ -192,6 +192,7 @@ int ssl23_accept(SSL *s)
 					}
 				if (!BUF_MEM_grow(buf,SSL3_RT_MAX_PLAIN_LENGTH))
 					{
+					BUF_MEM_free(buf);
 					ret= -1;
 					goto end;
 					}
diff --git a/ssl/s2_srvr.c b/ssl/s2_srvr.c
index 2cba426..59ced3f 100644
--- a/ssl/s2_srvr.c
+++ b/ssl/s2_srvr.c
@@ -188,13 +188,21 @@ int ssl2_accept(SSL *s)
 			s->version=SSL2_VERSION;
 			s->type=SSL_ST_ACCEPT;
 
-			buf=s->init_buf;
-			if ((buf == NULL) && ((buf=BUF_MEM_new()) == NULL))
-				{ ret= -1; goto end; }
-			if (!BUF_MEM_grow(buf,(int)
-				SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER))
-				{ ret= -1; goto end; }
-			s->init_buf=buf;
+			if(s->init_buf == NULL)
+				{
+				if ((buf=BUF_MEM_new()) == NULL)
+					{
+					ret= -1;
+					goto end;
+					}
+				if (!BUF_MEM_grow(buf,(int) SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER))
+					{
+					BUF_MEM_free(buf);
+					ret= -1;
+					goto end;
+					}
+				s->init_buf=buf;
+				}
 			s->init_num=0;
 			s->ctx->stats.sess_accept++;
 			s->handshake_func=ssl2_accept;


hooks/post-receive
-- 
OpenSSL source code


More information about the openssl-commits mailing list