mirror of
https://github.com/vim/vim.git
synced 2025-10-06 05:44:14 -04:00
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.
This commit is contained in:
@@ -1619,7 +1619,7 @@ suggest_trie_walk(
|
||||
// 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);
|
||||
|
Reference in New Issue
Block a user