summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorJon Spillett <jon.spillett@oracle.com>2017-03-02 12:54:06 +1000
committerRich Salz <rsalz@openssl.org>2017-03-02 09:38:39 -0500
commit2d951d8cdef56aeeb6c08387531de943683e80ce (patch)
tree1c44d3aa6ab36f3e38eb7dfcce9b4e8c51e15b61 /ssl
parent41371618f72b93bdf3e0a4be369e4df6b65334cd (diff)
Check for zero records and return immediately
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2822) (cherry picked from commit a3004c820370b6bee82c919721fb1cbe95f72f3f)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/record/ssl3_record.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ssl/record/ssl3_record.c b/ssl/record/ssl3_record.c
index 03c5294046..5da44e5efb 100644
--- a/ssl/record/ssl3_record.c
+++ b/ssl/record/ssl3_record.c
@@ -661,6 +661,9 @@ int tls1_enc(SSL *s, SSL3_RECORD *recs, unsigned int n_recs, int send)
const EVP_CIPHER *enc;
unsigned int ctr;
+ if (n_recs == 0)
+ return 0;
+
if (send) {
if (EVP_MD_CTX_md(s->write_hash)) {
int n = EVP_MD_CTX_size(s->write_hash);