[openssl-commits] [openssl] OpenSSL source code branch OpenSSL_1_0_0-stable updated. OpenSSL_1_0_0o-43-geae2bb2

Matt Caswell matt at openssl.org
Sat Dec 13 00:15:59 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_0-stable has been updated
       via  eae2bb2f1f5347c0bd305026fd3c222e0ccd69e2 (commit)
       via  c3132708368e4d13ddfc74be225a979d16a6a37e (commit)
      from  af8a66d10d320b614a60493c94cf5995a3639f87 (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 eae2bb2f1f5347c0bd305026fd3c222e0ccd69e2
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 c3132708368e4d13ddfc74be225a979d16a6a37e
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 139f5f3..a14fb43 100644
--- a/ssl/d1_srvr.c
+++ b/ssl/d1_srvr.c
@@ -209,6 +209,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 f1974e0..d2b3317 100644
--- a/ssl/s23_srvr.c
+++ b/ssl/s23_srvr.c
@@ -185,6 +185,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 bc885e8..73a54dc 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