mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 08:56:29 +00:00
vim-patch:8.2.3582: reading uninitialized memory when giving spell suggestions
Problem: Reading uninitialized memory when giving spell suggestions.
Solution: Check that preword is not empty.
15d9890eee
This commit is contained in:
@@ -4082,7 +4082,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
|
||||
// char, e.g., "thes," -> "these".
|
||||
p = fword + sp->ts_fidx;
|
||||
MB_PTR_BACK(fword, p);
|
||||
if (!spell_iswordp(p, curwin)) {
|
||||
if (!spell_iswordp(p, curwin) && *preword != NUL) {
|
||||
p = preword + STRLEN(preword);
|
||||
MB_PTR_BACK(preword, p);
|
||||
if (spell_iswordp(p, curwin)) {
|
||||
|
Reference in New Issue
Block a user