From 659202c3e54107a3849d8e393a83f5dccffcae8c Mon Sep 17 00:00:00 2001 From: Mariotaku Date: Sat, 8 Jul 2023 15:09:45 +0900 Subject: [PATCH] fixed memcpy overlap (reported by AddressSanitizer) (#80) * removed unneeded memcpy --- src/PlatformCrypto.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/PlatformCrypto.c b/src/PlatformCrypto.c index 7859ea4..4955ce2 100644 --- a/src/PlatformCrypto.c +++ b/src/PlatformCrypto.c @@ -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;