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.
diff --git a/src/spellsuggest.c b/src/spellsuggest.c
index 4a71438..5b460a3 100644
--- a/src/spellsuggest.c
+++ b/src/spellsuggest.c
@@ -1953,7 +1953,8 @@
#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)