Patch 8.2.3582
Problem:    Reading uninitialized memory when giving spell suggestions.
Solution:   Check that preword is not empty.
Files:      src/spellsuggest.c, src/testdir/test_spell.vim


*** ../vim-8.2.3581/src/spellsuggest.c  2021-10-06 13:41:03.592314063 +0100
--- src/spellsuggest.c  2021-11-04 15:44:09.185493280 +0000
***************
*** 1619,1625 ****
                    // char, e.g., "thes," -> "these".
                    p = fword + sp->ts_fidx;
                    MB_PTR_BACK(fword, p);
!                   if (!spell_iswordp(p, curwin))
                    {
                        p = preword + STRLEN(preword);
                        MB_PTR_BACK(preword, p);
--- 1619,1625 ----
                    // char, e.g., "thes," -> "these".
                    p = fword + sp->ts_fidx;
                    MB_PTR_BACK(fword, p);
!                   if (!spell_iswordp(p, curwin) && *preword != NUL)
                    {
                        p = preword + STRLEN(preword);
                        MB_PTR_BACK(preword, p);
*** ../vim-8.2.3581/src/testdir/test_spell.vim  2020-10-07 11:58:41.157858444 
+0100
--- src/testdir/test_spell.vim  2021-11-04 15:37:38.227993023 +0000
***************
*** 839,844 ****
--- 839,852 ----
    call delete('XtestSpell')
  endfunc
  
+ func Test_spell_single_word()
+   new
+   silent! norm 0R00
+   spell! ßÂ
+   silent 0norm 0r$ Dvz=
+   bwipe!
+ endfunc
+ 
  let g:test_data_aff1 = [
        \"SET ISO8859-1",
        \"TRY 
esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ",
*** ../vim-8.2.3581/src/version.c       2021-11-04 15:10:07.361074289 +0000
--- src/version.c       2021-11-04 15:35:14.638177819 +0000
***************
*** 759,760 ****
--- 759,762 ----
  {   /* Add new patch number below this line */
+ /**/
+     3582,
  /**/

-- 
TALL KNIGHT OF NI: Ni!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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/20211104154640.D3B03C80053%40moolenaar.net.

Raspunde prin e-mail lui