projects
/
postgresql
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
690c543
)
Fix possible use of uninitialised value in ts_headline()
author
Teodor Sigaev
<teodor@sigaev.ru>
Fri, 8 Apr 2016 18:25:14 +0000
(21:25 +0300)
committer
Teodor Sigaev
<teodor@sigaev.ru>
Fri, 8 Apr 2016 18:25:14 +0000
(21:25 +0300)
Found during investigation of failure of skink buildfarm member and its
valgrind report.
Backpatch to all supported branches
src/backend/tsearch/wparser_def.c
patch
|
blob
|
history
diff --git
a/src/backend/tsearch/wparser_def.c
b/src/backend/tsearch/wparser_def.c
index 2faa15ebd4cb6fbd7f5bf7f402abdbcf9a2b68ae..ca352af331588ea1cbfe18fe3dcf9a3e5fdd104b 100644
(file)
--- a/
src/backend/tsearch/wparser_def.c
+++ b/
src/backend/tsearch/wparser_def.c
@@
-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))