Fix possible use of uninitialised value in ts_headline()

Found during investigation of failure of skink buildfarm member and its
valgrind report.

Backpatch to all supported branches
This commit is contained in:
Teodor Sigaev 2016-04-08 21:25:14 +03:00
parent 690c543550
commit cb0c8cbf31
1 changed files with 2 additions and 0 deletions

View File

@ -2465,6 +2465,8 @@ mark_hl_words(HeadlineParsedText *prs, TSQuery query, int highlight,
}
else
{ /* shorter cover :((( */
if (i > q)
i = q;
for (; curlen > min_words; i--)
{
if (!NONWORDTOKEN(prs->words[i].type))