@@ -793,9 +793,7 @@ CipherBase::UpdateResult CipherBase::Update(
793
793
} else if (static_cast <size_t >(buf_len) != (*out)->ByteLength ()) {
794
794
std::unique_ptr<BackingStore> old_out = std::move (*out);
795
795
*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);
799
797
}
800
798
801
799
// 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) {
890
888
} else if (static_cast <size_t >(out_len) != (*out)->ByteLength ()) {
891
889
std::unique_ptr<BackingStore> old_out = std::move (*out);
892
890
*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);
896
892
}
897
893
898
894
if (ok && kind_ == kCipher && IsAuthenticatedMode ()) {
@@ -996,9 +992,7 @@ bool PublicKeyCipher::Cipher(
996
992
} else if (out_len != (*out)->ByteLength ()) {
997
993
std::unique_ptr<BackingStore> old_out = std::move (*out);
998
994
*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);
1002
996
}
1003
997
1004
998
return true ;
0 commit comments