Browse Source

don't copy buffer to ifself

pull/1221/head
orignal 6 years ago
parent
commit
d320a89590
  1. 3
      libi2pd/Crypto.cpp

3
libi2pd/Crypto.cpp

@ -1036,7 +1036,8 @@ namespace crypto @@ -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

Loading…
Cancel
Save