@@ -716,9 +716,7 @@ CipherBase::UpdateResult CipherBase::Update(
716
716
} else if (static_cast <size_t >(buf_len) != (*out)->ByteLength ()) {
717
717
std::unique_ptr<BackingStore> old_out = std::move (*out);
718
718
*out = ArrayBuffer::NewBackingStore (env ()->isolate (), buf_len);
719
- memcpy (static_cast <char *>((*out)->Data ()),
720
- static_cast <char *>(old_out->Data ()),
721
- buf_len);
719
+ memcpy ((*out)->Data (), old_out->Data (), buf_len);
722
720
}
723
721
724
722
// When in CCM mode, EVP_CipherUpdate will fail if the authentication tag is
@@ -814,9 +812,7 @@ bool CipherBase::Final(std::unique_ptr<BackingStore>* out) {
814
812
} else if (static_cast <size_t >(out_len) != (*out)->ByteLength ()) {
815
813
std::unique_ptr<BackingStore> old_out = std::move (*out);
816
814
*out = ArrayBuffer::NewBackingStore (env ()->isolate (), out_len);
817
- memcpy (static_cast <char *>((*out)->Data ()),
818
- static_cast <char *>(old_out->Data ()),
819
- out_len);
815
+ memcpy ((*out)->Data (), old_out->Data (), out_len);
820
816
}
821
817
822
818
if (ok && kind_ == kCipher && IsAuthenticatedMode ()) {
@@ -892,9 +888,7 @@ bool PublicKeyCipher::Cipher(
892
888
*out = ArrayBuffer::NewBackingStore (env->isolate (), 0 );
893
889
} else {
894
890
*out = ArrayBuffer::NewBackingStore (env->isolate (), buf.size ());
895
- memcpy (static_cast <char *>((*out)->Data ()),
896
- static_cast <char *>(buf.get ()),
897
- buf.size ());
891
+ memcpy ((*out)->Data (), buf.get (), buf.size ());
898
892
}
899
893
900
894
return true ;
0 commit comments