[openssl-commits] [openssl] master update

Rich Salz rsalz at openssl.org
Tue Apr 11 16:10:32 UTC 2017


The branch master has been updated
       via  cbbe9186f3d625f98aecb3f4dd4aaf457066b25c (commit)
      from  0856e3f167964f58c26796331eab9d8b0a883921 (commit)


- Log -----------------------------------------------------------------
commit cbbe9186f3d625f98aecb3f4dd4aaf457066b25c
Author: Rich Salz <rsalz at openssl.org>
Date:   Tue Apr 11 11:59:59 2017 -0400

    Additional check to handle BAD SSL_write retry
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/3124)

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

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

diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c
index 562b9e4..14c6778 100644
--- a/ssl/record/rec_layer_s3.c
+++ b/ssl/record/rec_layer_s3.c
@@ -356,7 +356,8 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, size_t len,
      * promptly send beyond the end of the users buffer ... so we trap and
      * report the error in a way the user will notice
      */
-    if (len < s->rlayer.wnum) {
+    if ((len < s->rlayer.wnum) 
+        || ((wb->left != 0) && (len < (s->rlayer.wnum + s->rlayer.wpend_tot)))) {
         SSLerr(SSL_F_SSL3_WRITE_BYTES, SSL_R_BAD_LENGTH);
         return -1;
     }


More information about the openssl-commits mailing list