summaryrefslogtreecommitdiff
path: root/src/memline.c
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2021-06-21 21:08:08 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-21 21:08:08 +0200
commit226b28b96150e59375d2bff44e0aadd382b0c3f1 (patch)
treeca0225ef8907a75b2dcc0296f0378939bb53cb21 /src/memline.c
parent22f17a29cd0b0cc3107dc6cd1d96c62eee52a7d9 (diff)
downloadvim-git-226b28b96150e59375d2bff44e0aadd382b0c3f1.tar.gz
patch 8.2.3032: build problems with MSVC, other crypt issues with libsodiumv8.2.3032
Problem: Build problems with MSVC, other crypt issues with libsodium. Solution: Adjust MSVC makefile. Disable swap file only when 'key' is set. Adjust error message used when key is wrong. Fix Coverity issues. (Christian Brabandt, closes #8420, closes #8411)
Diffstat (limited to 'src/memline.c')
-rw-r--r--src/memline.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/memline.c b/src/memline.c
index 3b09a7dd4..f1c2a8a52 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -497,7 +497,8 @@ ml_set_crypt_key(
return; // no memfile yet, nothing to do
old_method = crypt_method_nr_from_name(old_cm);
- if (old_method == CRYPT_M_SOD || crypt_get_method_nr(buf) == CRYPT_M_SOD)
+ // Swapfile encryption not supported by XChaCha20
+ if (crypt_get_method_nr(buf) == CRYPT_M_SOD && *buf->b_p_key != NUL)
{
// close the swapfile
mf_close_file(buf, TRUE);