fixed memcpy overlap (reported by AddressSanitizer) (#80)

* removed unneeded memcpy
This commit is contained in:
Mariotaku 2023-07-08 15:09:45 +09:00 • committed by GitHub
commit 659202c3e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -89,7 +89,6 @@ bool PltEncryptMessage(PPLT_CRYPTO_CONTEXT ctx, int algorithm, int flags,
size_t encryptedLength = 0;
unsigned char * encryptedData = tag;
size_t encryptedCapacity = outLength + tagLength;
memcpy(encryptedData + inputDataLength, tag, tagLength);
if (mbedtls_cipher_auth_encrypt_ext(&ctx->ctx, iv, ivLength, NULL, 0, inputData, inputDataLength, encryptedData,
encryptedCapacity, &encryptedLength, tagLength) != 0) {
return false;