Patch 8.2.3484
Problem:    Crash when going through spell suggestions.
Solution:   Limit the text length for finding suggestions to the original
            length.  Do not update buffers when exiting. (closes #8965)
Files:      src/spellsuggest.c, src/clipboard.c,
            src/testdir/test_spell_utf8.vim


*** ../vim-8.2.3483/src/spellsuggest.c  2021-06-11 18:07:36.734247944 +0100
--- src/spellsuggest.c  2021-10-06 13:39:41.399196420 +0100
***************
*** 1178,1183 ****
--- 1178,1188 ----
      p = su->su_badptr + su->su_badlen;
      (void)spell_casefold(curwin, p, (int)STRLEN(p), fword + n, MAXWLEN - n);
  
+     // Make sure the resulting text is not longer than the original text.
+     n = (int)STRLEN(su->su_badptr);
+     if (n < MAXWLEN)
+       fword[n] = NUL;
+ 
      for (lpi = 0; lpi < curwin->w_s->b_langp.ga_len; ++lpi)
      {
        lp = LANGP_ENTRY(curwin->w_s->b_langp, lpi);
*** ../vim-8.2.3483/src/clipboard.c     2021-06-04 16:11:44.516100707 +0100
--- src/clipboard.c     2021-10-06 12:36:12.065498809 +0100
***************
*** 199,205 ****
                                            || get_real_state() == SELECTMODE)
                && (cbd == &clip_star ?
                                clip_isautosel_star() : clip_isautosel_plus())
!               && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC))
        {
            update_curbuf(INVERTED_ALL);
            setcursor();
--- 199,206 ----
                                            || get_real_state() == SELECTMODE)
                && (cbd == &clip_star ?
                                clip_isautosel_star() : clip_isautosel_plus())
!               && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC)
!               && !exiting)
        {
            update_curbuf(INVERTED_ALL);
            setcursor();
*** ../vim-8.2.3483/src/testdir/test_spell_utf8.vim     2020-08-02 
15:10:02.355921894 +0100
--- src/testdir/test_spell_utf8.vim     2021-10-06 13:37:45.273621669 +0100
***************
*** 765,768 ****
--- 765,784 ----
    set spellfile=Xdir/Xtest.utf-8.add,Xtest_other.add
  endfunc
  
+ func Test_no_crash_with_weird_text()
+   new
+   let lines =<< trim END
+       r<sfile>
+       €
+ 
+ 
+       €
+   END
+   call setline(1, lines)
+   exe "%norm \<C-v>ez=>\<C-v>wzG"
+ 
+   bwipe!
+ endfunc
+ 
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.3483/src/version.c       2021-10-06 11:27:17.766745946 +0100
--- src/version.c       2021-10-06 13:32:39.465508498 +0100
***************
*** 759,760 ****
--- 759,762 ----
  {   /* Add new patch number below this line */
+ /**/
+     3484,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
110. You actually volunteer to become your employer's webmaster.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20211006124137.6ED48C80055%40pakwach.moolenaar.net.

Raspunde prin e-mail lui