summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2017-04-11 12:17:54 -0400
committerRich Salz <rsalz@openssl.org>2017-04-11 12:17:54 -0400
commit71d66c46c725a88a8d14b747610656e15610109e (patch)
treedf64a19f90ef38f02dcf09cf6dce7d7c6a05ec63 /ssl
parenta91bfe2f55892f625d5a30171efa0fdfd2814abe (diff)
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/3122)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/s3_pkt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c
index 39cdbaf898..0290c991d8 100644
--- a/ssl/s3_pkt.c
+++ b/ssl/s3_pkt.c
@@ -670,7 +670,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int 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 < tot) {
+ if ((len < tot) || ((wb->left != 0) && (len < (tot + s->s3->wpend_tot)))) {
SSLerr(SSL_F_SSL3_WRITE_BYTES, SSL_R_BAD_LENGTH);
return (-1);
}