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.
diff --git a/src/spell.c b/src/spell.c
index ae4db12..947bee5 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -2308,11 +2308,14 @@
/* 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;