Check for zero records and return immediately
authorJon Spillett <jon.spillett@oracle.com>
Thu, 2 Mar 2017 02:54:06 +0000 (12:54 +1000)
committerRich Salz <rsalz@openssl.org>
Thu, 2 Mar 2017 14:28:58 +0000 (09:28 -0500)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2822)

ssl/record/ssl3_record.c

index 84f54cb..3868bb5 100644 (file)
@@ -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);