aboutsummaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2017-04-11 11:59:59 -0400
committerRich Salz <rsalz@openssl.org>2017-04-11 11:59:59 -0400
commitcbbe9186f3d625f98aecb3f4dd4aaf457066b25c (patch)
tree0c12a445cb7f832875a6838492e801c76eceb563 /ssl
parent0856e3f167964f58c26796331eab9d8b0a883921 (diff)
downloadopenssl-cbbe9186f3d625f98aecb3f4dd4aaf457066b25c.tar.gz
Additional check to handle BAD SSL_write retry
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3124)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/record/rec_layer_s3.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c
index 562b9e454b..14c6778ae6 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;
}