diff options
author | f380cedric <f380cedric@users.noreply.github.com> | 2022-01-06 16:59:54 +0100 |
---|---|---|
committer | f380cedric <f380cedric@users.noreply.github.com> | 2022-01-06 18:47:31 +0100 |
commit | c6dddc3464dbaa71e31a779df51ac2f1af977237 (patch) | |
tree | 48f2eef2a40a5db3b6c1d109ec337758fdddca41 /src/nvim/spell.c | |
parent | 09d270bcea5f81a0772e387244cc841e280a5339 (diff) | |
download | rneovim-c6dddc3464dbaa71e31a779df51ac2f1af977237.tar.gz rneovim-c6dddc3464dbaa71e31a779df51ac2f1af977237.tar.bz2 rneovim-c6dddc3464dbaa71e31a779df51ac2f1af977237.zip |
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.
https://github.com/vim/vim/commit/15d9890eee53afc61eb0a03b878a19cb5672f732
Diffstat (limited to 'src/nvim/spell.c')
-rw-r--r-- | src/nvim/spell.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 9429a06e92..1296d410f6 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -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)) { |