0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 9.0.1669: Crash syncing swapfile in new buffer when using sodium crypt

Problem:    Crash syncing swapfile in new buffer when using sodium crypt.
            (James McCoy)
Solution:   Add checks for sodium encryption. (Christian Brabandt,
            closes #12591, closes #12585)
This commit is contained in:
Christian Brabandt
2023-06-27 18:57:10 +01:00
committed by Bram Moolenaar
parent 0256d76a33
commit 19e6c4fd2d
6 changed files with 72 additions and 14 deletions

View File

@@ -1267,6 +1267,13 @@ crypt_sodium_buffer_decode(
}
# if defined(FEAT_SODIUM) || defined(PROTO)
void
crypt_sodium_lock_key(char_u *key)
{
if (sodium_init() >= 0)
sodium_mlock(key, STRLEN(key));
}
int
crypt_sodium_munlock(void *const addr, const size_t len)
{