diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2016-04-08 21:25:32 +0300 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2016-04-08 21:25:32 +0300 |
commit | bf73016e01f0b9eb7c9ad1916a75d1c3bf78f743 (patch) | |
tree | 9aad94863fbca2458069b81e7c8e02fe3cd85e27 /src | |
parent | 8491679434d824bcb3a1d1713070261056683476 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/tsearch/wparser_def.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/tsearch/wparser_def.c b/src/backend/tsearch/wparser_def.c index 18ff9e2961c..c03b7271206 100644 --- a/src/backend/tsearch/wparser_def.c +++ b/src/backend/tsearch/wparser_def.c @@ -2441,6 +2441,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)) |