postgres.git / summary / log / commit / refs
commit b2a9e161ddb94daf3fa69e177b7e48ee944ec5a2
Author: Teodor Sigaev <teodor@sigaev.ru>
Date: Fri Apr 08 18:25:47 2016 +0000
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
src/backend/tsearch/wparser_def.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/backend/tsearch/wparser_def.c b/src/backend/tsearch/wparser_def.c
index d53f2e75c2e..cbf35e9e06e 100644
--- a/src/backend/tsearch/wparser_def.c
+++ b/src/backend/tsearch/wparser_def.c
@@ -2439,6 +2439,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))
[parent: f79a7fa90a71]