[openssl] OpenSSL_1_1_1-stable update

Matt Caswell matt at openssl.org
Mon Aug 5 16:24:56 UTC 2019


The branch OpenSSL_1_1_1-stable has been updated
       via  f2bb79a78a1681f9a137d7560a17982f6e54333c (commit)
      from  74b9ce2d84a5feb36e391fc179fef16a058665e2 (commit)


- Log -----------------------------------------------------------------
commit f2bb79a78a1681f9a137d7560a17982f6e54333c
Author: Matt Caswell <matt at openssl.org>
Date:   Thu Aug 1 14:55:25 2019 +0100

    Fix SSL_MODE_RELEASE_BUFFERS functionality
    
    At some point in the past do_ssl3_write() used to return the number of
    bytes written, or a value <= 0 on error. It now just returns a success/
    error code and writes the number of bytes written to |tmpwrit|.
    
    The SSL_MODE_RELEASE_BUFFERS code was still looking at the return code
    for the number of bytes written rather than |tmpwrit|. This has the effect
    that the buffers are not released when they are supposed to be.
    
    Fixes #9490
    
    Reviewed-by: Paul Dale <paul.dale at oracle.com>
    (Merged from https://github.com/openssl/openssl/pull/9505)
    
    (cherry picked from commit 8bbf63e48f27c5edaa03e6d87d969c9b6a207f3c)

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

Summary of changes:
 ssl/record/rec_layer_s3.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c
index b65137c332..982a06089c 100644
--- a/ssl/record/rec_layer_s3.c
+++ b/ssl/record/rec_layer_s3.c
@@ -635,8 +635,9 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, size_t len,
              */
             s->s3->empty_fragment_done = 0;
 
-            if ((i == (int)n) && s->mode & SSL_MODE_RELEASE_BUFFERS &&
-                !SSL_IS_DTLS(s))
+            if (tmpwrit == n
+                    && (s->mode & SSL_MODE_RELEASE_BUFFERS) != 0
+                    && !SSL_IS_DTLS(s))
                 ssl3_release_write_buffer(s);
 
             *written = tot + tmpwrit;


More information about the openssl-commits mailing list