0
0
mirror of https://github.com/vim/vim.git synced 2025-10-17 07:44:28 -04:00

updated for version 7.4.102

Problem:    Crash when interrupting "z=".
Solution:   Add safety check for word length. (Christian Brabandt, Dominique
            Pelle)
This commit is contained in:
Bram Moolenaar
2013-11-21 17:42:31 +01:00
parent 438ee5bf60
commit ace8d8ee2f
2 changed files with 5 additions and 3 deletions

View File

@@ -13398,9 +13398,8 @@ add_sound_suggest(su, goodword, score, lp)
/* Lookup the word "orgnr" one of the two tries. */
n = 0;
wlen = 0;
wordcount = 0;
for (;;)
for (wlen = 0; wlen < MAXWLEN - 3; ++wlen)
{
i = 1;
if (wordcount == orgnr && byts[n + 1] == NUL)
@@ -13414,6 +13413,7 @@ add_sound_suggest(su, goodword, score, lp)
if (i > byts[n]) /* safety check */
{
STRCPY(theword + wlen, "BAD");
wlen += 3;
goto badword;
}
@@ -13426,7 +13426,7 @@ add_sound_suggest(su, goodword, score, lp)
wordcount += wc;
}
theword[wlen++] = byts[n + i];
theword[wlen] = byts[n + i];
n = idxs[n + i];
}
badword:

View File

@@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
102,
/**/
101,
/**/