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_1-pre1~2192 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a3004c820370b6bee82c919721fb1cbe95f72f3f;p=oweals%2Fopenssl.git Check for zero records and return immediately Reviewed-by: Matt Caswell Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2822) --- diff --git a/ssl/record/ssl3_record.c b/ssl/record/ssl3_record.c index 84f54cbabd..3868bb5d82 100644 --- a/ssl/record/ssl3_record.c +++ b/ssl/record/ssl3_record.c @@ -740,6 +740,9 @@ int tls1_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send) int imac_size; const EVP_CIPHER *enc; + 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);