|
|
4cbc0c |
diff -up vim80/src/globals.h.cve1621 vim80/src/globals.h
|
|
|
4cbc0c |
--- vim80/src/globals.h.cve1621 2022-05-24 12:46:44.883952323 +0200
|
|
|
4cbc0c |
+++ vim80/src/globals.h 2022-05-24 12:47:30.534183523 +0200
|
|
|
4cbc0c |
@@ -1657,6 +1657,11 @@ EXTERN int *eval_lavars_used INIT(= NULL
|
|
|
4cbc0c |
EXTERN int ctrl_break_was_pressed INIT(= FALSE);
|
|
|
4cbc0c |
#endif
|
|
|
4cbc0c |
|
|
|
4cbc0c |
+#ifdef FEAT_SPELL
|
|
|
4cbc0c |
+EXTERN char e_illegal_character_in_word[]
|
|
|
4cbc0c |
+ INIT(= N_("E1280: Illegal character in word"));
|
|
|
4cbc0c |
+#endif
|
|
|
4cbc0c |
+
|
|
|
4cbc0c |
/*
|
|
|
4cbc0c |
* Optional Farsi support. Include it here, so EXTERN and INIT are defined.
|
|
|
4cbc0c |
*/
|
|
|
4cbc0c |
diff -up vim80/src/mbyte.c.cve1621 vim80/src/mbyte.c
|
|
|
4cbc0c |
--- vim80/src/mbyte.c.cve1621 2018-04-09 14:55:56.000000000 +0200
|
|
|
4cbc0c |
+++ vim80/src/mbyte.c 2022-05-24 12:22:13.166893098 +0200
|
|
|
4cbc0c |
@@ -4034,7 +4034,7 @@ theend:
|
|
|
4cbc0c |
convert_setup(&vimconv, NULL, NULL);
|
|
|
4cbc0c |
}
|
|
|
4cbc0c |
|
|
|
4cbc0c |
-#if defined(FEAT_GUI_GTK) || defined(PROTO)
|
|
|
4cbc0c |
+#if defined(FEAT_GUI_GTK) || defined(FEAT_SPELL) || defined(PROTO)
|
|
|
4cbc0c |
/*
|
|
|
4cbc0c |
* Return TRUE if string "s" is a valid utf-8 string.
|
|
|
4cbc0c |
* When "end" is NULL stop at the first NUL.
|
|
|
4cbc0c |
diff -up vim80/src/spellfile.c.cve1621 vim80/src/spellfile.c
|
|
|
4cbc0c |
--- vim80/src/spellfile.c.cve1621 2022-05-24 12:22:13.167893104 +0200
|
|
|
4cbc0c |
+++ vim80/src/spellfile.c 2022-05-24 12:49:55.816919350 +0200
|
|
|
4cbc0c |
@@ -4441,6 +4441,10 @@ store_word(
|
|
|
4cbc0c |
int res = OK;
|
|
|
4cbc0c |
char_u *p;
|
|
|
4cbc0c |
|
|
|
4cbc0c |
+ // Avoid adding illegal bytes to the word tree.
|
|
|
4cbc0c |
+ if (enc_utf8 && !utf_valid_string(word, NULL))
|
|
|
4cbc0c |
+ return FAIL;
|
|
|
4cbc0c |
+
|
|
|
4cbc0c |
(void)spell_casefold(word, len, foldword, MAXWLEN);
|
|
|
4cbc0c |
for (p = pfxlist; res == OK; ++p)
|
|
|
4cbc0c |
{
|
|
|
4cbc0c |
@@ -6251,6 +6255,12 @@ spell_add_word(
|
|
|
4cbc0c |
int i;
|
|
|
4cbc0c |
char_u *spf;
|
|
|
4cbc0c |
|
|
|
4cbc0c |
+ if (enc_utf8 && !utf_valid_string(word, NULL))
|
|
|
4cbc0c |
+ {
|
|
|
4cbc0c |
+ emsg(_(e_illegal_character_in_word));
|
|
|
4cbc0c |
+ return;
|
|
|
4cbc0c |
+ }
|
|
|
4cbc0c |
+
|
|
|
4cbc0c |
if (idx == 0) /* use internal wordlist */
|
|
|
4cbc0c |
{
|
|
|
4cbc0c |
if (int_wordlist == NULL)
|