From: Jon Spillett Date: Thu, 2 Mar 2017 02:54:06 +0000 (+1000) Subject: Check for zero records and return immediately X-Git-Tag: OpenSSL_1_1_0f~189 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d951d8cdef56aeeb6c08387531de943683e80ce;p=openssl Check for zero records and return immediately Reviewed-by: Matt Caswell Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2822) (cherry picked from commit a3004c820370b6bee82c919721fb1cbe95f72f3f) --- 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);