Problem: Crash when interrupting "z=".
Solution: Add safety check for word length. (Christian Brabandt, Dominique
Pelle)
/* 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)
if (i > byts[n]) /* safety check */
{
STRCPY(theword + wlen, "BAD");
+ wlen += 3;
goto badword;
}
wordcount += wc;
}
- theword[wlen++] = byts[n + i];
+ theword[wlen] = byts[n + i];
n = idxs[n + i];
}
badword:
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 102,
/**/
101,
/**/