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)
diff --git a/src/optionstr.c b/src/optionstr.c
index fa7084c..06958aa 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -1174,6 +1174,10 @@
*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;
}