Skip to content

Commit 8758fb0

Browse files
committed
updated for version 7.4.102
Problem: Crash when interrupting "z=". Solution: Add safety check for word length. (Christian Brabandt, Dominique Pelle)
1 parent 6a53075 commit 8758fb0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/spell.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13398,9 +13398,8 @@ add_sound_suggest(su, goodword, score, lp)
1339813398

1339913399
/* Lookup the word "orgnr" one of the two tries. */
1340013400
n = 0;
13401-
wlen = 0;
1340213401
wordcount = 0;
13403-
for (;;)
13402+
for (wlen = 0; wlen < MAXWLEN - 3; ++wlen)
1340413403
{
1340513404
i = 1;
1340613405
if (wordcount == orgnr && byts[n + 1] == NUL)
@@ -13414,6 +13413,7 @@ add_sound_suggest(su, goodword, score, lp)
1341413413
if (i > byts[n]) /* safety check */
1341513414
{
1341613415
STRCPY(theword + wlen, "BAD");
13416+
wlen += 3;
1341713417
goto badword;
1341813418
}
1341913419

@@ -13426,7 +13426,7 @@ add_sound_suggest(su, goodword, score, lp)
1342613426
wordcount += wc;
1342713427
}
1342813428

13429-
theword[wlen++] = byts[n + i];
13429+
theword[wlen] = byts[n + i];
1343013430
n = idxs[n + i];
1343113431
}
1343213432
badword:

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
102,
741743
/**/
742744
101,
743745
/**/

0 commit comments

Comments
 (0)