[openssl] master update

Dr. Paul Dale pauli at openssl.org
Thu Mar 18 11:15:42 UTC 2021


The branch master has been updated
       via  145f12d12dc83c737676883c625c2a95d34251ed (commit)
       via  b875e0e820b07420429ebb90724ed28686a98853 (commit)
      from  cf3306dc6b37cc24ea50cebc227a9354fefce158 (commit)


- Log -----------------------------------------------------------------
commit 145f12d12dc83c737676883c625c2a95d34251ed
Author: Pauli <ppzgs1 at gmail.com>
Date:   Wed Mar 17 11:41:48 2021 +1000

    modes: fix coverity 1449860: overlapping memory copy
    
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/14584)

commit b875e0e820b07420429ebb90724ed28686a98853
Author: Pauli <ppzgs1 at gmail.com>
Date:   Wed Mar 17 11:40:13 2021 +1000

    modes: fix coverity 1449851: overlapping memory copy
    
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/14584)

-----------------------------------------------------------------------

Summary of changes:
 crypto/modes/cbc128.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/crypto/modes/cbc128.c b/crypto/modes/cbc128.c
index df0ab244f8..86dd781c55 100644
--- a/crypto/modes/cbc128.c
+++ b/crypto/modes/cbc128.c
@@ -69,7 +69,8 @@ void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
         in += 16;
         out += 16;
     }
-    memcpy(ivec, iv, 16);
+    if (ivec != iv)
+        memcpy(ivec, iv, 16);
 }
 
 void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
@@ -114,7 +115,8 @@ void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
                 out += 16;
             }
         }
-        memcpy(ivec, iv, 16);
+        if (ivec != iv)
+            memcpy(ivec, iv, 16);
     } else {
         if (STRICT_ALIGNMENT &&
             ((size_t)in | (size_t)out | (size_t)ivec) % sizeof(size_t) != 0) {


More information about the openssl-commits mailing list