diff --git a/libi2pd/Crypto.cpp b/libi2pd/Crypto.cpp index 3f214b0e..7a947d34 100644 --- a/libi2pd/Crypto.cpp +++ b/libi2pd/Crypto.cpp @@ -1036,7 +1036,8 @@ namespace crypto } } // encrypt/decrypt data and add to hash - memcpy (buf, msg, msgLen); + if (buf != msg) + memcpy (buf, msg, msgLen); if (encrypt) { chacha20 (buf, msgLen, nonce, key, 1); // encrypt