@@ -793,9 +793,7 @@ CipherBase::UpdateResult CipherBase::Update(
793793 } else if (static_cast <size_t >(buf_len) != (*out)->ByteLength ()) {
794794 std::unique_ptr<BackingStore> old_out = std::move (*out);
795795 *out = ArrayBuffer::NewBackingStore (env ()->isolate (), buf_len);
796- memcpy (static_cast <char *>((*out)->Data ()),
797- static_cast <char *>(old_out->Data ()),
798- buf_len);
796+ memcpy ((*out)->Data (), old_out->Data (), buf_len);
799797 }
800798
801799 // When in CCM mode, EVP_CipherUpdate will fail if the authentication tag is
@@ -890,9 +888,7 @@ bool CipherBase::Final(std::unique_ptr<BackingStore>* out) {
890888 } else if (static_cast <size_t >(out_len) != (*out)->ByteLength ()) {
891889 std::unique_ptr<BackingStore> old_out = std::move (*out);
892890 *out = ArrayBuffer::NewBackingStore (env ()->isolate (), out_len);
893- memcpy (static_cast <char *>((*out)->Data ()),
894- static_cast <char *>(old_out->Data ()),
895- out_len);
891+ memcpy ((*out)->Data (), old_out->Data (), out_len);
896892 }
897893
898894 if (ok && kind_ == kCipher && IsAuthenticatedMode ()) {
@@ -996,9 +992,7 @@ bool PublicKeyCipher::Cipher(
996992 } else if (out_len != (*out)->ByteLength ()) {
997993 std::unique_ptr<BackingStore> old_out = std::move (*out);
998994 *out = ArrayBuffer::NewBackingStore (env->isolate (), out_len);
999- memcpy (static_cast <char *>((*out)->Data ()),
1000- static_cast <char *>(old_out->Data ()),
1001- out_len);
995+ memcpy ((*out)->Data (), old_out->Data (), out_len);
1002996 }
1003997
1004998 return true ;
0 commit comments