summaryrefslogtreecommitdiffstats
path: root/src/optionstr.c
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2023-06-27 18:57:10 +0100
committerBram Moolenaar <Bram@vim.org>2023-06-27 18:57:10 +0100
commit19e6c4fd2d262075d39cb802ea5b85f5ec92f153 (patch)
treea550dc395cbf1f136c384e0fddfe12dbcd4831e3 /src/optionstr.c
parent0256d76a3392aef270b38d1cf7633008e45c2003 (diff)
patch 9.0.1669: Crash syncing swapfile in new buffer when using sodium cryptv9.0.1669
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)
Diffstat (limited to 'src/optionstr.c')
-rw-r--r--src/optionstr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/optionstr.c b/src/optionstr.c
index fa7084c65c..06958aab2c 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -1174,6 +1174,10 @@ did_set_cryptkey(optset_T *args)
*curbuf->b_p_cm == NUL ? p_cm : curbuf->b_p_cm);
changed_internal();
}
+# ifdef FEAT_SODIUM
+ if (crypt_method_is_sodium(crypt_get_method_nr(curbuf)))
+ crypt_sodium_lock_key(args->os_newval.string);
+# endif
return NULL;
}