[openssl-commits] [openssl] OpenSSL source code branch OpenSSL_1_0_1-stable updated. OpenSSL_1_0_1j-63-gc983a77

Matt Caswell matt at openssl.org
Sat Dec 13 00:15:41 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_1-stable has been updated
       via  c983a77887519f4f82f4b0745a6d91f36344eedf (commit)
       via  7516eaf49216c3525506c9dedc008737c4a06501 (commit)
      from  c6a84ff3516d8ecd92d866b6f0ae0d63df6d9c53 (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 c983a77887519f4f82f4b0745a6d91f36344eedf
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>
    (cherry picked from commit d04a1e0b5beb3329cdf8c4ec35b9113cbc41d2f2)

commit 7516eaf49216c3525506c9dedc008737c4a06501
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>
    (cherry picked from commit bb1ddd3d9a0d01656b90693a214b911995a5fe8c)

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

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 6a075b3..a5660bc 100644
--- a/ssl/d1_srvr.c
+++ b/ssl/d1_srvr.c
@@ -233,6 +233,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 de909b1..3178815 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