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
parent ed7d72c07d
commit 659202c3e5

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;