mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-24 05:31:13 +00:00
fixed memcpy overlap (reported by AddressSanitizer) (#80)
* removed unneeded memcpy
This commit is contained in:
@@ -89,7 +89,6 @@ bool PltEncryptMessage(PPLT_CRYPTO_CONTEXT ctx, int algorithm, int flags,
|
|||||||
size_t encryptedLength = 0;
|
size_t encryptedLength = 0;
|
||||||
unsigned char * encryptedData = tag;
|
unsigned char * encryptedData = tag;
|
||||||
size_t encryptedCapacity = outLength + tagLength;
|
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,
|
if (mbedtls_cipher_auth_encrypt_ext(&ctx->ctx, iv, ivLength, NULL, 0, inputData, inputDataLength, encryptedData,
|
||||||
encryptedCapacity, &encryptedLength, tagLength) != 0) {
|
encryptedCapacity, &encryptedLength, tagLength) != 0) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user