vim-patch:8.2.5007: spell suggestion may use uninitialized memory

Problem:    Spell suggestion may use uninitialized memory. (Zdenek Dohnal)
Solution:   Avoid going over the end of the word.
6d24b4ff69
This commit is contained in:
zeertzjq
2022-05-23 19:17:09 +08:00
parent bafb53604a
commit 80af2c6055
2 changed files with 23 additions and 4 deletions

View File

@@ -4381,7 +4381,9 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
#endif
++depth;
sp = &stack[depth];
++sp->ts_fidx;
if (fword[sp->ts_fidx] != NUL) {
sp->ts_fidx++;
}
tword[sp->ts_twordlen++] = c;
sp->ts_arridx = idxs[arridx];
if (newscore == SCORE_SUBST) {