diff src/spell.c @ 16277:5ef25fa57f71 v8.1.1143

patch 8.1.1143: may pass weird strings to file name expansion commit https://github.com/vim/vim/commit/8f130eda4747e4a4d68353cdb650f359fd01469b Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 10 22:15:19 2019 +0200 patch 8.1.1143: may pass weird strings to file name expansion Problem: May pass weird strings to file name expansion. Solution: Check for matching characters. Disallow control characters.
author Bram Moolenaar <Bram@vim.org>
date Wed, 10 Apr 2019 22:30:06 +0200
parents 5df26b29e809
children 7e733046db1d
line wrap: on
line diff
--- a/src/spell.c
+++ b/src/spell.c
@@ -2308,11 +2308,14 @@ did_set_spelllang(win_T *wp)
     /* Loop over comma separated language names. */
     for (splp = spl_copy; *splp != NUL; )
     {
-	/* Get one language name. */
+	// Get one language name.
 	copy_option_part(&splp, lang, MAXWLEN, ",");
 	region = NULL;
 	len = (int)STRLEN(lang);
 
+	if (!valid_spellang(lang))
+	    continue;
+
 	if (STRCMP(lang, "cjk") == 0)
 	{
 	    wp->w_s->b_cjk = 1;